[Vuejs]-Uncaught SyntaxError: Unexpected token '<' in Laravel/Vue Application

2👍

The issue is found and it was coming from the asset() function of laravel as it could not pick up the app.js from the public directory for some reasons which caused the application to return the html page because in the web.php, I have told it to hit the same controller action for anything that comes after the / in the url. Now I edited the line <script src="{{ asset('js/app.js') }}" defer></script> and changed it to <script src="{{ asset('public/js/app.js') }}" defer></script> which picks the js file properly and returns the js code that handles the Single Page Application routes and I do not see the issue anymore.

Thank you all for participating and helping me find out the issue.

Leave a comment