Skip to content

Missed imports when transpiling in IE11 (but not in Chrome/Edge/FF) #29193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexi2014 opened this issue Dec 28, 2018 · 3 comments
Closed

Missed imports when transpiling in IE11 (but not in Chrome/Edge/FF) #29193

alexi2014 opened this issue Dec 28, 2018 · 3 comments
Labels
Bug A bug in TypeScript

Comments

@alexi2014
Copy link

TypeScript Version: 3.2.2
Browser: IE11

Search Terms:

Code

// Source
import * as theModule from 'someModule';
let myObj = {
    handler: () => {
        let f = function(val) {
            return theModule.someFunction();
        }
        f();
    }
};    

// Output in IE11 begins with (missed dependency, incorrect):
System.register([], function (exports_1, context_1) {
// Output in Chrome/Edge/FF begins with (dependency is present, correct):
System.register(["someModule"], function (exports_1, context_1) {

Expected behavior:
Source code is transpiled in run-time in a browser. It imports 'someModule' module, and uses a function from it (theModule.someFunction()), so the transpiled code for the System module type should reference 'someModule' in the System.register call, like here:

System.register(["someModule"], ...

Actual behavior:
This is how it works in Chrome/Edge/FF browsers, but not in IE11. In IE11 the module reference is missed, like here:

System.register([], ...

Repro sample:
Clone the following repo:
https://github.com/alexi2014/TS-IE-Missed-Import

npm install
npm run start

The page will be opened in the default browser. The top text area contains source code, and the bottom one contains transpiled code.
Depending on the browser where you open the page (Chrome/Edge/FF vs IE11), the transpiled result will be different.

Related Issues:

@alexi2014
Copy link
Author

This can also be seen in the playground

@weswigham weswigham added the Bug A bug in TypeScript label Jan 3, 2019
@weswigham
Copy link
Member

This is probably indicative of an issue in our internal Map polyfill.

@weswigham
Copy link
Member

Probably related: #26090

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants