You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the app with composer native:dev, styles load correctly.
But after building the app with php artisan native:build, all Vite assets fail to load.
In DevTools, you may see errors like:
GET http://[::1]:5173/resources/css/app.css net::ERR_CONNECTION_REFUSED
Cause
The file public/hot was still present when building the app.
When public/hot exists, Laravel's @vite() helper assumes a dev server is running and tries to load assets from port 5173 — which does not exist in the packaged NativePHP app.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
When running the app with
composer native:dev, styles load correctly.But after building the app with
php artisan native:build, all Vite assets fail to load.In DevTools, you may see errors like:
GET http://[::1]:5173/resources/css/app.css net::ERR_CONNECTION_REFUSEDCause
The file
public/hotwas still present when building the app.When
public/hotexists, Laravel's@vite()helper assumes a dev server is running and tries to load assets from port 5173 — which does not exist in the packaged NativePHP app.Solution
Ensure
public/hotis removed before building.Example fix in
config/nativephp.php:Or explicitly remove it in
prebuild:Beta Was this translation helpful? Give feedback.
All reactions