Configuration "resources/js/app.js" does not exist.
See original GitHub issue- Laravel Vite Plugin Version: 0.2.0
- Laravel Version: 9.19.0
- Node Version: 18.4.0
- NPM Version: 8.12.1
- Inertia Version: 0.6.3
Description:
Upon running npm run dev
Laravel throws:
Configuration "resources/js/app.js" does not exist.
Steps To Reproduce:
- Follow the official Laravel docs
- Replace ‘mix’ directive with ‘vite’ directive in app.blade.php
Went so far as to make changes in the vite.config file with no success. Also used an absolute URL for the resources and error persists.
Dumped composer and cleared Laravel and browser cache with no success.
There is a post on Stackoverflow with a similar issue: https://stackoverflow.com/questions/72799267/why-laravel-vite-directive-not-working-in-my-project
Issue Analytics
- State:
- Created a year ago
- Comments:25 (11 by maintainers)
Top Results From Across the Web
Laravel Vite - Configuration does not exist - Stack Overflow
But the problem occurred when I tried to access the resource and it says Configuration "resources/js/app.js" does not exist.
Read more >Unable to locate file in Vite manifest: resources/css/app.css
config.js file has "resources/sass/app.scss". My resources/css/app.css file is currently empty as it's a new project ...
Read more >Asset Bundling (Vite) - The PHP Framework For Web Artisans
Vite is configured via a vite.config.js file in the root of your project. You are free to customize this file based on your...
Read more >Configuration with app.json / app.config.js
Configuration with app.json/app.config.js. Learn about what is Expo config and how you can dynamically use it by customizing it.
Read more >Module Federation - webpack
js, etc. Relative and absolute request in shared: Will always be provided, even if not used. Will resolve relative to config.context ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for sharing these. I can now see the issue you are facing.
You currently have the community Vite plugin and the Laravel plugin active, and they are conflicting with each other.
The PHP package
"innocenzi/laravel-vite"
along with the NPM package"vite-plugin-laravel"
are part of the fantastic community Vite plugin.This is a great plugin that has many features and you may wish to continue using it. If you do want to use the community plugin, I recommend uninstalling the
"laravel-vite-plugin"
NPM package.Then you should refer to the documentation: https://laravel-vite.dev/
Alternatively, if you would like to use framework version, you should uninstall the
"innocenzi/laravel-vite"
composer package and additionally uninstall the"vite-plugin-laravel"
NPM package.Ensure that you have only followed the steps in the official upgrade guide.
Finally, if you are still having issues, you may need to run:
to bust the view cache. I hope that gets you back on track.
Hehe, i just got the error on the developement project - same code as the one on production , which was live for a few months now - and i couldn’t understand why.
After i made the upgrade from webpack to vite, i forgot to delete the generated views from blade ( php artisan view:clear ) which was using the app.js from public folder…
The
@vite()
accepts as a paramter the config name from configs/vite.php file - so it is not correct to use@vite('resources/js/app.js')
( laravel mix was using the path of the files… ) but instead use@vite('default')
or just@vite()
- since in the code of Innocenzi / Vite you will find this line:$name ??= config('vite.default');
- so if you don’t set a name it will get the vite.default confing by default.So when you migrate from webpack to vite on InertiaJS - just clear your views generate by laravel ( php artisan view:clear - or manually delete the storage/framework/views folder )