-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Tree-shakable providers IE10 #24339
Comments
Same thing happens in my project with IE10 |
I got my app working by doing the next. In angular 6 the cli generated services are created like: After removing the object parameter from the Injectable marker, and adding the service to the providers array of the module it is used in, this bug is not showing anymore. So the service looks like this: |
@mrkapocs That works but it's a workaround and not really desired behavior imho. |
@beyerleinf Yeah, I know. This is still a serious problem, and my solution is just a workaround for those who need it. |
In the StackBlitz
Does it work if you use the reflect polyfill that's specified for IE9? |
@alxhub I created this StackBlitz https://stackblitz.com/edit/angular-9ecstk and didn't modify anything. Does this have the import you mean? As you can see in this image, it doesn't work in IE10 |
@beyerleinf StackBlitz depends on Firebase which only supports IE11+, that issue has nothing to do with Angular, it's impossible to reproduce IE compatible problem via StackBlitz. |
@meiordac I'm unable to reproduce the problem on downloaded official tutorial project (with polyfills enabled): Could you please create a new Angular CLI project on GitHub to reproduce it? |
@trotyl My bad |
Looks like there is a problem in IE10 in dev mode when there are transitive injections. Simple use case: @Injectable() // ← doesn't matter where it is provided
export class B {
}
@Injectable({providedIn: 'root'})
export class A {
constructor(b: B) {}
}
@Component({ ... })
export class App {
constructor(a: A) {}
} Same thing if you replace |
I'm happy to report that this was fixed in e3759f7. The fix is in 6.1 beta currently, and will be released in 6.1. The bug only affects JIT mode, so as a workaround until then you can test your apps with AOT in IE10. |
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. |
I'm submitting a...
Current behavior
After upgrading to Angular 6 from Angular 5 I tried to implement tree-shakable services but
IE10 is giving me the following error: Uncaught (in promise): TypeError: Unable to get property 'ngMetadataName' of undefined or null reference
Expected behavior
Tree-shakable services work without errors in IE10.
Minimal reproduction of the problem with instructions
https://angular.io/generated/live-examples/toh-pt6/stackblitz.html
Stackblitz does not seem to work in IE10 either.
What is the motivation / use case for changing the behavior?
Use tree shakable components including IE10
Environment
The text was updated successfully, but these errors were encountered: