Uncaught SyntaxError: Unexpected token < console error

i am working on laravel/vuejs app and i have this error in the console

Uncaught SyntaxError: Unexpected token <

the error in modernizr.custom.js but i connt handle it

Looks like the browser tries to load some JavaScript file from the server, but instead receives an html file - wither something like a 404.html or index.html.

1 Like

Hi, i have the same issue.

After running npm run build, console logs

Uncaught SyntaxError: Unexpected token <

Please i need help resolving this.

hi @Goche in my case it was actually a problem in the path
i used relative path instead of the absolute path.
this how i solved it <script src="{{ asset('js/app.js') }}"></script>

this link explains the problem just like what @LinusBorg said

How do i know if i used relative path instead of the absolute path.

And where do i specify that?

Sorry about the amateur question.

don`t worry, i am a junior too
this article might help

i am using laravel template in almost all my projects, so i specify this in my main layout (.blade) file

but instead, if u are using vue-cli project
this question might help