JavaScript module not working in Edge (version 44, make 18.17763) [closed]

我与影子孤独终老i 提交于 2021-01-28 11:30:47

问题


I am having trouble with my JavaScript module in the Edge browser. In Chrome everything works perfectly. Since my users have both Edge and Chrome available to them, the application has to work in both. In my html head-section I have:

<script type="module" src="{% static "js/app.js" %}"></script>

The {% static "js/app.js" %} is a django template-tag.

The app.js begins like this:

"use strict";

import { editor } from "./editor.js";
import { homepage } from "./home.js";
import { contactPage } from "./contact.js";

jQuery( window ).on( "load", () =>
{ // code... }

In the inspector network-tab I can see that app.js, editor.js, home.js and contact.js are loaded with status 200 (OK).

The console gives me:

HTML1406: Invalid start of a tag '<?'

HTML1500: The tag can not be a self-closing tag

Those warnings are generated in an svg-file that starts with <?xml ..... and when I remove that and close the tags in the svg with a proper closing-tag the problem is NOT solved.

As I said: in chrome everything works fine. I don't know if there is any other code that could be relevant. Maybe anyone else came across this problem. I am clueless.

来源:https://stackoverflow.com/questions/65610984/javascript-module-not-working-in-edge-version-44-make-18-17763

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!