-
Notifications
You must be signed in to change notification settings - Fork 12k
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
v1.5.1 AOT Build - Uncaught ReferenceError: InjectionToken is not defined #8518
Comments
I have a similar issue. My app worked fine with 5.0.1 and CLI 1.5.0. Once I upgraded to 1.5.1, the app fails to load properly and the first error I get is from one of my components: The offending line of code is a declaration of a property of my component before the constructor:
Moving this initialization to the constructor didn't help. My app works fine with a JIT build, but breaks once AOT is involved. |
Same here. I'm getting Code that causes the error: // some code....
import { Inject, Injectable, Optional, Renderer, SkipSelf, InjectionToken } from '@angular/core';
// some code....
export const CLIPBOARD_SERVICE_PROVIDER = {
provide: ClipboardService,
deps: [DOCUMENT, WINDOW, [
new Optional(), // -<<< error
new SkipSelf(),
ClipboardService
]],
useFactory: CLIPBOARD_SERVICE_PROVIDER_FACTORY
};
// some code.... |
I'm having the same issue as @bomberblue07. Even just |
Confirmed that @angular/cli 1.5.1 seems to be the issue Works with --prod on 1.5.0
Fails with --prod on 1.5.1
|
Confirmed same issus at @angular/cli 1.5.1 when launching the app: ng build --prod main.d559f48d0942eebadd8a.bundle.js:1 ERROR ReferenceError: EventEmitter is not defined |
We're investigating. If we haven't found a root cause in 15-30 minutes after this message we'll revert the PR and do an emergency release. |
I reverted the |
updated old handlebars reference by dependency due to security vulnerability
If an import imports multiple symbols, the previous condition meant that the whole import statement was removed, instead of only the symbol. Fixes angular#8518.
If an import imports multiple symbols, the previous condition meant that the whole import statement was removed, instead of only the symbol. Fixes #8518.
@hansl Thanks for the quick response and fix. Much appreciated 👍 |
If an import imports multiple symbols, the previous condition meant that the whole import statement was removed, instead of only the symbol. Fixes #8518.
If an import imports multiple symbols, the previous condition meant that the whole import statement was removed, instead of only the symbol. Fixes #8518.
If an import imports multiple symbols, the previous condition meant that the whole import statement was removed, instead of only the symbol. Fixes angular#8518.
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. |
Versions
Repro steps
ng serve --aot
Observed behavior
Desired behavior
The app builds fine in AOT mode with no error, but when I run it in the browser, it results in the error provided above during bootstrap process. I tried to reproduce this error on CLI
1.5.0
and it works fine. It complains aboutInjectionToken
being not defined.Mention any other details that might be useful (optional)
Only happening on
v1.5.1
, works onv1.5.0
. No other dependency was changed. All I did was upgrade@angular/cli
from1.5.0
to1.5.1
.The text was updated successfully, but these errors were encountered: