Skip to content

Commit 7f8d512

Browse files
docs(mobile/3): note Inertia 3 axios requirement in development guide (#370)
NativePHP Mobile intercepts axios at bundle time to route HTTP requests through the embedded PHP runtime. Inertia 3 removed axios in favour of native fetch, so fresh Inertia 3 projects fail the NativePHP build until they declare axios as a direct dependency. Adds an aside to mobile/3/getting-started/development in the section that already introduces the nativephpMobile Vite plugin — that's the natural home for build-time concerns — with the single `npm install axios` step and a link to Inertia's client-side-setup docs for wiring it up. Pairs with NativePHP/mobile-air#100 which makes the Vite plugin fail early with an error pointing here and at the Inertia docs. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 103d24d commit 7f8d512

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

resources/views/docs/mobile/3/getting-started/development.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ npm run build -- --mode=ios
6666
npm run build -- --mode=android
6767
```
6868

69+
<aside>
70+
71+
#### Using Inertia 3?
72+
73+
NativePHP Mobile routes every outgoing HTTP request through the embedded PHP runtime
74+
by intercepting `axios` at bundle time. [Inertia 3 removed axios][inertia-axios] in
75+
favour of native `fetch`, so fresh Inertia 3 projects won't declare it — the
76+
NativePHP build will fail until you add axios as a direct dependency:
77+
78+
```shell
79+
npm install axios
80+
```
81+
82+
Then follow the [Inertia docs on using axios][inertia-axios] to tell Inertia to use
83+
it for its client-side requests. Apps on Inertia 2 (or using axios directly) already
84+
have it installed and don't need any change.
85+
86+
[inertia-axios]: https://inertiajs.com/docs/v3/installation/client-side-setup#using-axios
87+
88+
</aside>
89+
6990
## Compile your app
7091

7192
To compile and run your app, simply run:

0 commit comments

Comments
 (0)