Skip to content

docs(mobile/3): note Inertia 3 axios requirement#370

Merged
shanerbaner82 merged 1 commit intomainfrom
docs/inertia-3-axios-requirement
Apr 23, 2026
Merged

docs(mobile/3): note Inertia 3 axios requirement#370
shanerbaner82 merged 1 commit intomainfrom
docs/inertia-3-axios-requirement

Conversation

@shanerbaner82
Copy link
Copy Markdown
Contributor

@shanerbaner82 shanerbaner82 commented Apr 23, 2026

Summary

Adds an aside to `mobile/3/getting-started/development.md` (in the existing nativephpMobile Vite plugin section) explaining that fresh Inertia 3 projects need to reinstall axios for NativePHP Mobile to work.

Context

NativePHP Mobile intercepts `axios` at bundle time and swaps its transport adapter so every HTTP request routes through the embedded PHP runtime. Through Inertia 2 this was always satisfied transitively by `@inertiajs/vue3` / `@inertiajs/react`. Inertia 3 removed axios in favour of native `fetch`, so fresh Inertia 3 projects now build cleanly into a NativePHP app that can't talk to its own backend.

The paired package change — NativePHP/mobile-air#100 — makes the Vite plugin fail fast (checking the project's `package.json` for a declared axios dependency) with an error pointing users here and at the Inertia docs.

Placement

Inline aside inside Build your frontend → The `nativephpMobile` Vite plugin, right after the `--mode=ios`/`--mode=android` build commands. That's the natural home for build-time concerns, and the surrounding section already contextualises the Vite plugin where the check fires.

Preview

Using Inertia 3?

NativePHP Mobile routes every outgoing HTTP request through the embedded PHP runtime by intercepting `axios` at bundle time. Inertia 3 removed axios in favour of native `fetch`, so fresh Inertia 3 projects won't declare it — the NativePHP build will fail until you add axios as a direct dependency:

npm install axios

Then follow the Inertia docs on using axios to tell Inertia to use it for its client-side requests. Apps on Inertia 2 (or using axios directly) already have it installed and don't need any change.

🤖 Generated with Claude Code

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>
@shanerbaner82 shanerbaner82 force-pushed the docs/inertia-3-axios-requirement branch from 8c356a5 to 90840c5 Compare April 23, 2026 20:37
@shanerbaner82 shanerbaner82 merged commit 7f8d512 into main Apr 23, 2026
2 checks passed
@shanerbaner82 shanerbaner82 deleted the docs/inertia-3-axios-requirement branch April 23, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant