Repository navigation
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Description
Bug, feature request, or proposal:
Bug.
What is the expected behavior?
MdSnackBar works with AOT compilation.
What is the current behavior?
MdSnackBar doesn't work with AOT compilation (angular/cli).
ERROR Error: Uncaught (in promise): Error: No provider for t!
Error
at g (polyfills.794b327….bundle.js:36)
at k (vendor.4ef56f0….bundle.js:204)
at O (vendor.4ef56f0….bundle.js:204)
at t._throwOrNull (vendor.4ef56f0….bundle.js:351)
at t._getByKeyDefault (vendor.4ef56f0….bundle.js:351)
at t._getByKey (vendor.4ef56f0….bundle.js:351)
at t.get (vendor.4ef56f0….bundle.js:351)
at e.get [as _MdSnackBar_104] (main.b2f8da9….bundle.js:1)
at e.getInternal (main.b2f8da9….bundle.js:1)
at e.t.get (vendor.4ef56f0….bundle.js:365)
at e.t.get (vendor.4ef56f0….bundle.js:365)
at t.get [as _MdSnackBar_67] (13.d98dce3….chunk.js:8)
at t.getInternal (13.d98dce3….chunk.js:8)
at t.get (vendor.4ef56f0….bundle.js:365)
at un (vendor.4ef56f0….bundle.js:281)
at g (polyfills.794b327….bundle.js:36)
at k (vendor.4ef56f0….bundle.js:204)
at O (vendor.4ef56f0….bundle.js:204)
at t._throwOrNull (vendor.4ef56f0….bundle.js:351)
at t._getByKeyDefault (vendor.4ef56f0….bundle.js:351)
at t._getByKey (vendor.4ef56f0….bundle.js:351)
at t.get (vendor.4ef56f0….bundle.js:351)
at e.get [as _MdSnackBar_104] (main.b2f8da9….bundle.js:1)
at e.getInternal (main.b2f8da9….bundle.js:1)
at e.t.get (vendor.4ef56f0….bundle.js:365)
at e.t.get (vendor.4ef56f0….bundle.js:365)
at t.get [as _MdSnackBar_67] (13.d98dce3….chunk.js:8)
at t.getInternal (13.d98dce3….chunk.js:8)
at t.get (vendor.4ef56f0….bundle.js:365)
at un (vendor.4ef56f0….bundle.js:281)
at g (polyfills.794b327….bundle.js:36)
at l (polyfills.794b327….bundle.js:36)
at l (polyfills.794b327….bundle.js:36)
at polyfills.794b327….bundle.js:36
at t.invokeTask (polyfills.794b327….bundle.js:36)
at Object.onInvokeTask (vendor.4ef56f0….bundle.js:365)
at t.invokeTask (polyfills.794b327….bundle.js:36)
at n.runTask (polyfills.794b327….bundle.js:36)
at u (polyfills.794b327….bundle.js:36)
at XMLHttpRequest.invoke (polyfills.794b327….bundle.js:36)
What are the steps to reproduce?
Import MdSnackBar as DI in any component and run npm run build -- -prod.
Which versions of Angular, Material, OS, browsers are affected?
angular/material: 2.0.0-beta.2 (from material2-builds)
angular/cli: 1.0.0
node: 7.7.4
os: darwin x64
angular: 4.0.0
Reacted by ocam-ua
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Activity
[-]MdSnakBar error with AOT compilation[/-][+]MdSnackBar error with AOT compilation[/+]PManaras commentedon Mar 27, 2017
I had the same issue, fixed it by adding ' LiveAnnouncer' to the list of providers, after importing:
import { MaterialModule, LiveAnnouncer } from '@angular/material';
angular-automatic-lock-bot commentedon Sep 5, 2019
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.