I am using Laravel 8.x in Windows 10 along with Vue 2.6.12. I am working my way through a video on combining Vue with Laravel. The video is for an older version of Laravel, probably 5.5, and probably a slightly older Vue as well so that may well be the nature of my problem. Here's the link to the video. I'm at about the 8:00 minute mark.
The problem I'm having is that when I try to execute my code, Laravel isn't seeing the app.js file no matter how much I experiment with the src parameter of the script tag. (I have a good imagination and I've done a LOT of experimenting.) The Laravel manual has not been of much help here except that I saw it mentioned an ASSET_URL parameter for the .env file so I tried specifying the leading part of the path there but nothing I've tried works; I inevitably get a 404 error. (For what it's worth, I've tried removing asset() and just coding a path the traditional way but that doesn't work either.)
My app.js file is at /resources/assets/js/app.js. The file that contains the script tag, layout.blade.php, is at /resources/views/layout.blade.php. The code in the script tag says:
<script src=" asset('js/app.js')"></script> just like the video. In the .env file, ASSET_URL='/resources/assets/'. What do I need to change to make this work? I can't think of anything else to try!
{{ asset'/js/app.js') }}you've missed the{{ }}npm run watchwas completed sucessfully then it will not return but keep running in the background and building your JS every time you make changes. Being able to run it again indicates that it might have not ran properly