-
Notifications
You must be signed in to change notification settings - Fork 12k
Build optimizer leads to the broken build with AOT and ES2015 #8505
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
Comments
got the same error only in Prod Build with aot and build optmizer on |
It appears that |
@clydin how did you test it with |
|
@clydin I tried upgrading to |
@kzc thanks for keeping us posted on the bug status 👍 It looks like it was fixed in mishoo/UglifyJS#2504, which I suppose means it will be in the next release. |
@filipesilva Yes, The transformed code in question was https://github.com/angular/angular/blob/5.0.1/packages/core/src/application_ref.ts#L219-L249 As you know that corresponds to the npm package
with $ diff -u 0.js 1.js
--- 0.js 2017-11-24 10:51:36.000000000 -0500
+++ 1.js 2017-11-24 10:51:12.000000000 -0500
@@ -3523,18 +3523,18 @@
}
})), function(errorHandler, ngZone, callback) {
try {
- const result = (() => {
- const initStatus = moduleRef.injector.get(ApplicationInitStatus);
- return initStatus.runInitializers(), initStatus.donePromise.then(() => (this._moduleDoBootstrap(moduleRef),
- moduleRef));
- })();
+ const result = callback();
return isPromise(result) ? result.catch(e => {
throw ngZone.runOutsideAngular(() => errorHandler.handleError(e)), e;
}) : result;
} catch (e) {
throw ngZone.runOutsideAngular(() => errorHandler.handleError(e)), e;
}
- }(exceptionHandler, ngZone);
+ }(exceptionHandler, ngZone, () => {
+ const initStatus = moduleRef.injector.get(ApplicationInitStatus);
+ return initStatus.runInitializers(), initStatus.donePromise.then(() => (this._moduleDoBootstrap(moduleRef),
+ moduleRef));
+ });
});
}
bootstrapModule(moduleType, compilerOptions = []) { which I think is now in the correct scope. |
|
Hi all, please see #8571 (comment) for instructions on how you can force update to |
I can confirm that PS For Yarn users the simple way to update only necessary packages is to remove record for Example of
|
Partially address angular#5618 Fix angular#8571 Fix angular#8505
Partially address angular#5618 Fix angular#8571 Fix angular#8505
Partially address angular#5618 Fix angular#8571 Fix angular#8505
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
Repro steps.
The log given by the failure.
Desired functionality.
No error with build optimizer enabled.
Mention any other details that might be useful.
The issue was originally posted in #7797 (comment). I discovered that it is caused by build optimizer and not JIT mode, so creating separate issue for tracking purpose.
I traced it down back to this line. Changing amount of passed to 1 fixes the problem. It is probably a bug in UglifyJS after all, but I don't have enough expertise to trace it down and report correctly in their repo. Maybe somebody else can take it from here.
Relevant code snippet from exception:
The text was updated successfully, but these errors were encountered: