Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda