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

212
Views
How to fix MIME errors on refresh when using URL parameters

I don't know if I will be able to explain good enough but.. I have a setup like this

page(navigationMiddleware);

page('/', homeView);
page('/login', loginView);
page('/register', registerView);
page('/movies', catalogView);
page('/create', createView);
page('/search', searchView);
page('/movies/:movieId', detailsView);
page('/movies/:movieId/edit', editView);
page('/watch/:movieId', watchView);
page('*', notFoundView);

All pages work fine if I don't refresh the page. All pages without params after their route work fine even after refresh - everything renders perfectly. But when I am at any page with params on it (e.g. movies/idOfItem) and I try to refresh the page I get this 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.

And my page does not render.. My guess is that it loses the params?? when I refresh and can't render it because of that. But then how can I fix that? I don't know what the actual problem is. I hope someone can answer this.

I've got this error many times before, but it usually is because of wrong import paths or using something from page.js the wrong way, this might be the case here, but I don't know what to do..

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!