Skip to content

MdSnackBar error with AOT compilation #3798

@ocarreterom

Description

@ocarreterom

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

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions