When I generate the production version of my PWA built with VueJS I got this error in Google Chrome after deploying it to my server:
Uncaught SyntaxError: Unexpected token '<'
in app.21fde857.js:1Uncaught SyntaxError: Unexpected token '<'
in chunk-vendors.d1f8f63f.js:1I take a look in the Network tab of the console and in both files chunk-vendors.d1f8f63f.js
and app.21fde857.js
the index.html
is coming back with a status 200.
Why this occurs?
OBS: Locally this works perfectly.
Here is a solution that doesn't require hand-editing your dist assets. Simply add the following property to the exports of your vue.config.js:
publicPath: './'