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

260
Views
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 answers
Answer question

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 Report
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!