admin管理员组

文章数量:1290499

I want to wrap an angular application with cordova. After hitting "cordova run android" and inspecting it in Chrome, the console states:

"Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec."

On my phone I obviously only get a white screen then. How can I solve this issue?

When i hit "cordova serve" and look at it in the browser on my PC, there are no errors thrown and everything works fine.

Thank you in advance.

MIME type of ""

I want to wrap an angular application with cordova. After hitting "cordova run android" and inspecting it in Chrome, the console states:

"Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec."

On my phone I obviously only get a white screen then. How can I solve this issue?

When i hit "cordova serve" and look at it in the browser on my PC, there are no errors thrown and everything works fine.

Thank you in advance.

MIME type of ""

Share Improve this question edited Jun 27, 2019 at 20:39 Darius asked Jun 26, 2019 at 18:05 DariusDarius 1711 silver badge9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 13

I could figure it out, even if it is not a great solution I guess and there might be something nicer.

After running ng build --prod --aot I went into my index.html and put type="text/javascript" into the <script> tags.

So basically from

<script src="runtime-es2015.858f8dd898b75fe86926.js" type="module">

to

<script type="text/javascript" src="runtime-es2015.858f8dd898b75fe86926.js" type="module">

After that I got no more errors.

本文标签: androidServer responds with a nonJavaScript MIME type of quotquotStack Overflow