Resource interpreted as Script but transferred with MIME type text/plain:

Hi.
I have an asp.net angular application using visual studio 2013.
ok. if I run this application with IISExpress, it works fine. but, if I change to IIS, I got the title message above.

the source code of the page looks good, but the angular view is not loaded, so the display is totally empty.

thx in advance
Deraldo SilvaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
RobConnect With a Mentor Owner (Aidellio)Commented:
That's good to hear. At least you knew by ruling things out that it was your solution causing the issue.

Glad to have helped.
0
 
RobOwner (Aidellio)Commented:
This is a message from the browser because the MIME type is serving your script file (javascript?) as text.  They should be served as text/javascript (assuming javascript).

When including javascript in your site you should use the type

<script src="..." type="text/javascript"></script>
0
 
Deraldo SilvaAuthor Commented:
thx Rob for your attention.
I put type=text/javascript and text/css in all scripts and css and I still got the problem.

but why this would be a problem in IIS and not in IISexpress?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
RobOwner (Aidellio)Commented:
Because you can control how certain extensions can be served with what mime types. Maybe it's a default in the express version but is more flexible in iis?
0
 
RobOwner (Aidellio)Commented:
I'll check my setup and get back to you
0
 
Deraldo SilvaAuthor Commented:
ok. thx.
0
 
RobOwner (Aidellio)Commented:
yes, it looks like IIS you can specify the MIME type based on any extension.  Please confirm what you have for your .js and .css extensions as indicated by this screenshot of mine:

Capture.JPG
0
 
Deraldo SilvaAuthor Commented:
Hi Rob,  I think that you find the problem. But, I am using windows 8.1 pro. I could not find the Mime types in IIS to change. Could you help?

thx in advance.
0
 
RobOwner (Aidellio)Commented:
i'm also using windows 8.1 pro! :)

Capture.JPG
0
 
RobOwner (Aidellio)Commented:
Just check that you've got the same options installed:

Clipboard01.jpg
0
 
Deraldo SilvaAuthor Commented:
Ok. I got the Mime Types. Thx for your help.
Checked. all types are set correctly.

Meanwhile, I created another angular project, from scratch and it works ok. So I think the problem is the solution.

I will recreate my solution.

thx for your help and attention.
0
All Courses

From novice to tech pro — start learning today.