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

259
Vistas
Blazor Server Side MIME type error for content JS file

I've create a base assembly BaseDll that compiles as a referenced project by my main Blazor Server Side MainBSSApp.

The base assembly contains a few JS functions that are located in the myJSFile.js file of the BaseDll assembly (I've added them into a BaseDll.wwwroot folder).

So I add the reference to my JS file in MainBSSApp/Shared/_Host.cshtml (I actually tried several places, result is always the same - I now have it in the <head> section):

<script src="_content/BaseDll/myJSFile.js"></script>

When I execute the MainBSSApp on my standard VS version (Windows) all seems to work fine. Now I'm trying to migrate the project on Ubuntu with VS Code. Views referenced by BaseDll as well as services are working fine. However, as soon as I call any JS method defined in the myJSFile.js, I do get an error because the function is not defined - and righ before that, I get the warning that `The scritp from "[...]/_content/BaseDll/myJSFile.js" was loaded even though its MIME type ("text/html") is not a valid JavaScript MIME type."

So I tried this fix but without luck (I tried both 777 and 705 permission, nothing changed)...

What am I doing wrong here?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Solution is indeed to add the ./ before the _content

<script src="./_content/BaseDll/myJSFile.js"></script>

credits to @pcalkins and to the docs...

about 4 years ago · Juan Pablo Isaza Denunciar
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