I have this very old application made in Vue 2 and everything was working fine but just today, I am experiencing this error: Uncaught SystaxError: Unexpected Token '<'
.
When I click the link, it returns an HTML file, the index file of my project:
So to check, I tried to build npm run build
the project locally. Upon checking on the generated files, the file returns a proper script file.
I also tried to run the project on docker locally, and it was working fine. I tried the usually answer publicPath: '/'
but it does not work on my issue.
Can somebody tell what is wrong with my project build?
3
In my opinion this problem is mostly linked to your server configuration and not to your vue app.
Your app is requesting a JS file and getting back and html file.
The two most common sources would be:
- the js file requested does not exist on the server
- the webserver you’re using ( nginx for example ) isn’t well configured
Could you check that the server contains the js file ? if not could you share your nginx config ( or the config for the web server you’re using )
3