Syntax error in @angular/upgrade package due to differential loading
See original GitHub issueπ bug report
Affected Package
The issue is caused by package @angular/....@angular.upgrade@8.0.0-beta.13
Is this a regression?
Yes.
Yes, the previous version in which this bug was not present was: ....Description
Due to differential loading. My app uses setAngularJSGlobal
from @angular/upgrade/static
. That code is now loaded in the browser as ES2015 code. That results in this line: https://github.com/angular/angular/blob/master/packages/upgrade/src/common/src/angular1.ts#L299 throwing a βSyntax Errorβ:
Uncaught SyntaxError: Identifier 'module' has already been declared
When i look at the source, module
is already defined by webpack:
/***/ "../../node_modules/@angular/upgrade/fesm5/static.js":
/*!************************************************************************************************************************!*\
!*** /.../node_modules/@angular/upgrade/fesm5/static.js ***!
\************************************************************************************************************************/
/*! exports provided: Ι΅angular_packages_upgrade_static_static_e, Ι΅angular_packages_upgrade_static_static_c, Ι΅angular_packages_upgrade_static_static_a, Ι΅angular_packages_upgrade_static_static_d, Ι΅angular_packages_upgrade_static_static_b, getAngularJSGlobal, getAngularLib, setAngularJSGlobal, setAngularLib, downgradeComponent, downgradeInjectable, VERSION, downgradeModule, UpgradeComponent, UpgradeModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
A clear and concise description of the problem...
π¬ Minimal Reproduction
https://stackblitz.com/...π₯ Exception or Error
Uncaught SyntaxError: Identifier 'module' has already been declared
π Your Environment
Angular Version:
Angular CLI: 8.0.0-beta.16
Node: 10.15.2
OS: darwin x64
Angular: 8.0.0-beta.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, upgrade
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.0-beta.16
@angular-devkit/build-angular 0.800.0-beta.16
@angular-devkit/build-optimizer 0.800.0-beta.16
@angular-devkit/build-webpack 0.800.0-beta.16
@angular-devkit/core 8.0.0-beta.16
@angular-devkit/schematics 8.0.0-beta.16
@angular/cli 8.0.0-beta.16
@ngtools/webpack 8.0.0-beta.16
@schematics/angular 8.0.0-beta.16
@schematics/update 0.800.0-beta.16
rxjs 6.5.1
typescript 3.4.4
webpack 4.30.0
Anything else relevant?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
upgrade @angular/material get SyntaxError - Stack Overflow
We currently need to upgrade this project's angular version from 7.2.1 to latest version. as we need to add new feature in this...
Read more >A Guide to Angular 8's Differential Loading Feature - Auth0
In a nutshell, differential loading means to send newer, flashier code to newer browsers and stable legacy code to legacy browsers. ThisΒ ...
Read more >Angular 8: Upgrading & Summary of New Features
With differential loading, two bundles are created when building for production: a bundle for modern browsers that support ES2015+ and a bundle ......
Read more >Angular < 13: How to support IE11 - DEV Community β β
EDIT: FROM ANGULAR V13, IE11 CAN NO LONGER BE SUPPORTED. IF YOU NEED TO SUPPORT IE11, PLEASE USE A VERSION OF ANGULAR <13Β ......
Read more >A Guide to Angular 8's Differential Loading | by Auth0 | Medium
This generally translates into two things: modern syntax and polyfills. On a newer browser that supports recent syntax changes in JavaScript (such as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As far as I can tell, this is a webpack bug: https://github.com/webpack/webpack/issues/7369
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.