question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`import` is the keyword in IE even it's a property

See original GitHub issue
  function SystemJS () {
    this[REGISTRY] = {};
  }

  var systemJSPrototype = SystemJS.prototype;

  systemJSPrototype.import = function (id, parentUrl) {
    var loader = this;
    return Promise.resolve(loader.prepareImport())
    .then(function() {
      return loader.resolve(id, parentUrl);
    })
    .then(function (id) {
      var load = getOrCreateLoad(loader, id);
      return load.C || topLevelLoad(loader, load);
    });
  };

systemJSPrototype.import is work in the modern browser, but it doesn’t work in IE

even

const obj = {
  import: () => {} // throw in IE
}

function Module () {}

Module.import = function () {} // throw in IE

System.import('/xxx.js'); // throw in IE

This makes system.js not work in IE(including IE11) at all.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
guybedfordcommented, Sep 18, 2020

@axetroy as mentioned above there are other concerns here regarding IE<11 support. The only version of IE that is supported is IE11 (within which import is supported without quotes).

0reactions
axetroycommented, Sep 18, 2020

@joeldenning This is not a polyfill problem.

Is this my description is not clear enough?

I mean import is a keyword in IE(7,8,9,10,11).

Even if it’s a property like object.import = function () {}

This will cause the exception to be unusable in IE.

This is not a problem that polyfills can solve.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid module import when in IE - Stack Overflow
It's just this one package giving me troubles. It's calling animejs with a bunch of extentions extentions that are not compatible with IE...
Read more >
import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >
Python import: Advanced Techniques and Tips
In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring...
Read more >
Static import in Java - GeeksforGeeks
With the help of static import, we can access the static members of a class directly without class name or any object. For...
Read more >
Using Import-DSCResource - PowerShell | Microsoft Learn
Import-DSCResource is a dynamic keyword that can only be used inside a Configuration script block. It is used to import the resource modules ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found