Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngcc: processed umd bundles fail with syntax errors in IE11 #34525

Closed
devversion opened this issue Dec 21, 2019 · 0 comments
Closed

ngcc: processed umd bundles fail with syntax errors in IE11 #34525

devversion opened this issue Dec 21, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@devversion
Copy link
Member

@devversion devversion commented Dec 21, 2019

馃悶 bug report

Affected Package

@angular/compiler-cli - ngcc

Is this a regression?

Yes, this doesn't seem to happen in Angular v9.0.0-rc.6

Description

Processed UMD bundles sometimes seem to have superfluous comma tokens that break evaluation of the file in IE11.

// First broken code                                           鈫  
... factory(exports, require('rxjs'), require('rxjs/operators'),) :

// Second superfluous comma                                     鈫  
... define('@angular/core', ['exports', 'rxjs', 'rxjs/operators',]

// Third broken code                       鈫  
}(this, (function (exports, rxjs, operators,) { 'use strict';

Note: This all seems to happen in the canonical AMD module header. It seems to happen three times per bundle. Basically every time the dependencies of the AMD module are specified.

馃敩 Minimal Reproduction

https://github.com/devversion/ie11-ngcc-compat

馃敟 Exception or Error

SCRIPT1002: Syntax Error
core.umd.js (8,128)

馃實 Your Environment

Angular Version:

Angular v9.0.0-rc.7

@ngbot ngbot bot modified the milestone: needsTriage Dec 21, 2019
@devversion devversion modified the milestones: needsTriage, v9-candidates Dec 21, 2019
@gkalpak gkalpak self-assigned this Dec 21, 2019
gkalpak added a commit to gkalpak/angular that referenced this issue Dec 23, 2019
gkalpak added a commit to gkalpak/angular that referenced this issue Dec 23, 2019
Previously, if `UmdRenderingFormatter#addImports()` was called with an
empty list of imports to add (i.e. no new imports were needed), it would
add trailing commas in several locations (arrays, function arguments,
function parameters), thus making the code imcompatible with legacy
browsers such as IE11.

This commit fixes it by ensuring that no trailing commas are added if
`addImports()` is called with an empty list of imports.
This is a follow-up to angular#34353.

Fixes angular#34525
gkalpak added a commit to gkalpak/angular that referenced this issue Dec 23, 2019
Previously, if `UmdRenderingFormatter#addImports()` was called with an
empty list of imports to add (i.e. no new imports were needed), it would
add trailing commas in several locations (arrays, function arguments,
function parameters), thus making the code imcompatible with legacy
browsers such as IE11.

This commit fixes it by ensuring that no trailing commas are added if
`addImports()` is called with an empty list of imports.
This is a follow-up to angular#34353.

Fixes angular#34525
alxhub added a commit that referenced this issue Jan 7, 2020
Previously, if `UmdRenderingFormatter#addImports()` was called with an
empty list of imports to add (i.e. no new imports were needed), it would
add trailing commas in several locations (arrays, function arguments,
function parameters), thus making the code imcompatible with legacy
browsers such as IE11.

This commit fixes it by ensuring that no trailing commas are added if
`addImports()` is called with an empty list of imports.
This is a follow-up to #34353.

Fixes #34525

PR Close #34545
@alxhub alxhub closed this in 10e2935 Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.