Skip to content

Commit 8c356a5

Browse files
shanerbaner82claude
andcommitted
docs(mobile/3): note Inertia 3 axios requirement in installation guide
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 reinstall axios and register the Inertia axios adapter. Adds an aside to mobile/3/getting-started/installation explaining the requirement, the fix (`npm install axios @inertiajs/axios-adapter`), and links to the Inertia client-side-setup docs. Pairs with NativePHP/mobile-air#100 which makes the Vite plugin fail early with an error pointing here and at the Inertia adapter docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 103d24d commit 8c356a5

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ the heavy lifting for you.
9292

9393
For this reason, we also recommend you add the `nativephp` folder to your `.gitignore`.
9494

95+
<aside>
96+
97+
#### Using Inertia 3?
98+
99+
NativePHP Mobile routes every outgoing HTTP request through the embedded PHP runtime
100+
by intercepting `axios` at bundle time. [Inertia 3 removed axios][inertia-axios] in
101+
favour of native `fetch`, so fresh Inertia 3 projects won't have it installed — the
102+
NativePHP build fails until you add it back and wire up the Inertia axios adapter:
103+
104+
```shell
105+
npm install axios @inertiajs/axios-adapter
106+
```
107+
108+
Then follow the [Inertia docs on using axios][inertia-axios] to register the adapter
109+
in your client-side setup. Apps on Inertia 2 (or using axios directly) already have
110+
it installed and don't need any change.
111+
112+
[inertia-axios]: https://inertiajs.com/docs/v3/installation/client-side-setup#using-axios
113+
114+
</aside>
115+
95116
## Start your app
96117

97118
**Heads up!** Before starting your app in a native context, try running it in the browser. You may bump into exceptions

0 commit comments

Comments
 (0)