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

114
Views
Heroku deploy: single page app as Frontend and express as Backend

I try to deploy my app on Heroku.

My stack:

Backend: Express + Mongodb + Typescript

Frontend: Express + Vanilla JS (Single Page App)

Backend was deployed and working fine, problem is with Frontend. I wish I had used React, because with React I would know what to do. Problem is Vanilla JS. I must say that everything is working on my localhost, so problem exist after Heroku deployment.

In my index.html I have this line:

<script type="module" src="/static/javascript/index.js"></script>

And I see on Heroku app html from index.html, no css and in console that error: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

I think this is because Heroku try to go to localization https://my-app.herokuapp.com/static/javascript/index.js. How to tell Heroku to treat this path like a subfolder with module, not like localization to go?

When I work with React I tell in package.json to build frontend npm run build, what is substitution for this in Vanilla JS? How to say Heroku that this is Vanilla JS and build this?

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!