⚠️ Vite styles not loading in NativePHP build? Check public/hot #76
emmaferdez
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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