Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edge not loading ES 6 modules

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.

enter image description here

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:

enter image description here

But it loads only the non-module script in the debugger:

enter image description here

like image 394
Water Cooler v2 Avatar asked Apr 06 '19 07:04

Water Cooler v2


People also ask

Does Microsoft EDGE support ES6?

ECMAScript 2015 (ES6) is Fully Supported on Microsoft Edge 17.

Do browsers support ES6 modules?

ES6 modules can be used without bundling out of the box on most modern browsers. The latest versions of Chrome, Firefox, Edge, Safari and mobile versions of them all support it out of the box. Other than Internet Explorer, most popular browsers can load ES6 modules on their own.

How do I run ES6 browser?

Safari, Chrome, Firefox and Edge all support the ES6 Modules import syntax. Here's what they look like. Simply add type="module" to your script tags and the browser will load them as ES Modules. The browser will follow all import paths, downloading and executing each module only once.


1 Answers

  1. Navigate to about:flags
  2. Enable Enable experimental JavaScript features

And use <script type='module' src='./app.js'> will work.

source

like image 58
Ankit Sinha Avatar answered Oct 14 '22 00:10

Ankit Sinha