Vue App works on localhost but gets error messages on network access

When I run my VueJS App with npm run serve I get the following error messages

CHROME:
Failed to load resource: net::ERR_INVALID_HTTP_RESPONSE app.js:1
Failed to load resource: net::ERR_INVALID_HTTP_RESPONSE chunk-vendors.js:1

FIREFOX
Uncaught SyntaxError: invalid escape sequence chunk-vendors.js:1:72
Uncaught SyntaxError: invalid assignment left-hand side
app.js:1

SAFARI
[Error] Failed to load resource: Cancelled load from ‘http://192.168.1.50:8081/js/chunk-vendors.js’ because it is using HTTP/0.9. (chunk-vendors.js, line 0)
[Error] Failed to load resource: Cancelled load from ‘http://192.168.1.50:8081/js/app.js’ because it is using HTTP/0.9. (app.js, line 0)

Locally (localhost:8081) I can run my app without any problems. I guess somehow the app.js file can not be found. I couldn’t find any solution online.

The project: GitHub - raikm/homepanorama: The panorama dashboard should be a solution to overview important information and control automated tasks quickly.

Thanks in advance for the help!

The fact that in the safari Error its pointing to a localhost URL leads me to believe its a file path issue. I would have a look to see if your paths to files are correct. Change any absolute paths to relative ones.

On a ‘live server’ you shouldn’t ever be looking for a resource at “http://192.168.1.50:8081/js/app.js” it should be “http://sitedomain.com/js/app.js”.

Another couple things that could be causing the issue off the dome is that:

  • are you on a https url and requesting a resource from http?
  • are you using an adblocker? sometimes it blocks certain JS files from being loadded