Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
When compiling Vue-cli project and serving with nginx, console prints " Uncaught SyntaxError: Unexpected token '<' "

I am trying to run my Vue-Cli project on my server with nginx. I am fairly certain my nginx is set up correctly but you can look it over.

This is on vue 3.2.13, nginx 1.18.0 and ubuntu 20.04.4

root /var/www/html/;
index index.html;

location /vueProject/ {
         try_files $uri /vueProject/dist/index.html;
}

When visiting the page the console gives 2 errors

Uncaught SyntaxError: Unexpected token '<' both linking to Javascript files /js/chunk-vendors.44e4eb0a.js & /js/app.3856adea.js.

From what I have read it seems to not be able to fetch those files. When I view them in the dev tools they aren't loaded, they just appear as the index.html file.

I have tried changing publicPath: in vue.config.js but that didn't change it and adding . in front of the path to the files didn't change it either. So I am thinking the files might not be loaded by nginx and if that is the issue how would I solve that?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!