Skip to content

Unexpected value imported by the module 'AppModule'. Please add an annotation #13890

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

Closed
KeyStorke opened this issue Mar 12, 2019 · 3 comments
Closed

Comments

@KeyStorke
Copy link

KeyStorke commented Mar 12, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

I see the issue and that issue looks like a bug. The demo here: https://stackblitz.com/edit/angular-rbzdus

The same problem happens for ng build --prod as well.

🔬 Minimal Reproduction

You can do it here

MatSnackBar used in the notification.component.ts

🔥 Exception or Error


Unexpected value 'MatSnackBar' imported by the module 'AppModule'. Please add a @NgModule annotation.

Anything else relevant?
#7409

@KeyStorke KeyStorke changed the title Unexpected value imported by the module 'AppModule'. Please add a annotation Unexpected value imported by the module 'AppModule'. Please add an annotation Mar 12, 2019
@clydin
Copy link
Member

clydin commented Mar 12, 2019

It appears the demo is importing the component and not the module.

@KeyStorke
Copy link
Author

The issue was resolved.
Solution: change MatSnackBar to MatSnackBarModule in the module.ts

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants