aurelia / framework

The Aurelia 1 framework entry point, bringing together all the required sub-modules of Aurelia.
MIT License
11.75k stars 623 forks source link

IE11 fails to run Aurelia due to => not getting transpiled from TS to ES5 #914

Closed dmongrel closed 6 years ago

dmongrel commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: Aurelia fails to run in IE11. The aurelia-binding function camelCase() has a => which does not get transpiled to es5/es2015. In IE11, this causes a SCRIPT1002: Syntax error in vendor-bundle.js(6008,97)

Expected/desired behavior:

The fat arrow (=>) should be transpiled and not appear in vendor bundle, because IE11 cannot handle them. To reproduce, download aurelia-CLI, create a project, using TypeScript, no CSS, max-minification. My project has custom elements, so makes sure yours does as well.

EisenbergEffect commented 6 years ago

@dmongrel Can you update the CLI to beta.4. We just pushed a fix yesterday that I think is related to this. Let me know!

dmongrel commented 6 years ago

@EisenbergEffect Yes it seems to get through the errors related to transpiling to ES5. I'm not sure if this would be classified as the same bug, but, after the b4 version, the aurelia-loader-default throws an error in ensureOriginOnExports. It thinks that target is null or undefined when it reaches the if statement. I can file a new bug if you prefer.

function ensureOriginOnExports(executed, name) { var target = executed; var key = void 0; var exportedValue = void 0;

if (target.__useDefault) { target = target['default']; }

EisenbergEffect commented 6 years ago

@huochunpeng Are you available to look into this?

3cp commented 6 years ago

@dmongrel can you try reset the cache? au clear-cache

@bigopon I guess you did not see this error when testing on ie11?

bigopon commented 6 years ago

Let me test this properly first. I'll update as soon as I finish that

bigopon commented 6 years ago

It works totally fine in my local env. Here is how it looks like on IE11

image

With TS - Requirejs, for the following structure:

image

For the following app files: image

dmongrel commented 6 years ago

OK, I think we can close this issue. I tried a default project, and at least that works now. Thanks. Au clear-cache had no apparent effect on the issue, which appears to be something else. I'll have to track it down (likely is plugin-related: I'm using aurelia-jstree and aurelia-dialog). Those are the only things that should really be different from the default project.

dmongrel commented 6 years ago

Turns out the default error comes up, when tsconfig.json has compilerOptions target es2015. I changed it to es5 and that solved the remaining issue. Please close this issue, everything is now running as it should be. If you'd like me to file a bug regarding the compiler option, let me know.

Alexander-Taran commented 6 years ago

@dmongrel you can close it yourself (-: