Skip to content
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

MdSnackBar error with AOT compilation #3798

Closed
ocarreterom opened this issue Mar 27, 2017 · 2 comments · Fixed by #3807
Closed

MdSnackBar error with AOT compilation #3798

ocarreterom opened this issue Mar 27, 2017 · 2 comments · Fixed by #3807
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@ocarreterom
Copy link
Contributor

ocarreterom commented Mar 27, 2017

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

@ocarreterom ocarreterom changed the title MdSnakBar error with AOT compilation MdSnackBar error with AOT compilation Mar 27, 2017
@PManaras
Copy link

I had the same issue, fixed it by adding ' LiveAnnouncer' to the list of providers, after importing:
import { MaterialModule, LiveAnnouncer } from '@angular/material';

@devversion devversion self-assigned this Mar 27, 2017
@devversion devversion added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Mar 29, 2017
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants