Reputation: 33850
Microsoft Edge doesn't load my ES 6 modules. All other browsers (Opera, Safari, Chrome, Firefox) do.
It downloads them all fine but doesn't run them. I see only the non-module file. And the console does not report any errors.
I am using Edge 17.17134 on Windows 10.
This page suggests that Microsoft Edge with build number 16299 and above supports ES6 modules. As you can see from my version information above, my build number is 17134, so it must support them.
My page has the following 3 scripts included:
<script src="/Scripts/my/IfIE.js"></script>
<script src="/Scripts/my/sathyaish.js" type="module"></script>
<script src="/Scripts/my/index.js" type="module"></script>
It downloads them all fine:
But it loads only the non-module script in the debugger:
Upvotes: 11
Views: 4241
Reputation: 206
I had the same issue (other browsers are fine, but not Microsoft Edge (44.18362.387.0), no errors in console, all .js files loaded fine in Network tab). Further investigation showed that the problem was not with loading modules itself. "Hello world" example with modules worked fine in Edge and after that I started to eliminate parts of script that potentially could cause a problem. In my case it was map objects instantiation:
export default class A {
static B = new Map();
static C = new Map();
After replacement with
export default class A {
constructor() {
A.B = new Map();
A.C = new Map();
}
everything worked fine. So if it is possible to change your scripts, there is a chance to get them work in Edge too.
Upvotes: 0
Reputation: 1680
about:flags
Enable experimental JavaScript features
And use <script type='module' src='./app.js'>
will work.
Upvotes: 1