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
Uncaught Error: Unexpected value '[object Object]' imported by the module 'AppModule'. Please add a @NgModule annotation. #170
Comments
I can confirm this is also happening to me |
Same happening to me also after i updated Angular CLI |
+1 |
+1 |
Thank you for reporting. Related issue: angular/angular-cli#7384. If anyone knows what aspect of Angular CLI 1.3 is causing it, please let me know. Meanwhile, I will see if I can pinpoint the issue 👍 |
if you can please come with a solution it will make my day. This error seems to be affecting a lot of people |
When you Please try:
to make sure the consuming application searches for the peer dependencies in the application's node_modules directory. Can you let me know if that works? Thanks!! |
I even run "ng serve --preserve-symlinks" and the problem still not solved. before it was working well, however when I updated my Angular CLI from 1.1.1 to version 1.3.0 and tried to run the application, I encountered that error in my browser console. but when running 'ng serve' the application compiles successfully, however, the browser throws that error. https://github.com/saberhamidi/Cloud7Shisha the above link is my project in github, if you can please clone it and run it yourself, and see what is really happening. make sure you run it with Angular CLI version 1.3.0, and please let me know if you find the cause of it. thanks @jvandemo |
Good news! The --preserve-symlinks option is worked for both ng serve and ng builld. Now the error is gone and it works as expected. I found the below configuration is no longer required as well:
Thanks a lot @jvandemo and I appreciate that. |
glad that it worked for you, but i am still struggling :(, |
Yes, it works. I think we should add this to the documentation. |
worked for me too. |
@quahkj; @NetanelBasal, @osahner — Thank you for the confirmations, much appreciated! 👍 @saberhamidi — Is it possible to share your code so we can help you figure out what could be wrong? It could also be structure related, see angular/angular-cli#7384. Thanks! |
@quahkj I have included a github link of my project on my previous comment if you scroll up please, you can use it to download my code and try it yourself. |
i spend the whole day yesterday trying to find the cause of that error, but failed :( |
@saberhamidi - I suggest you create a new sample library project and a new angular cli project in your existing environment and try it out. Make sure it is worked in your environment first - just isolate any env related issue. |
I can confirm this exactly happening to me |
@shanthece — Can you try:
to see if that fixes your problem? |
Try to update the @angular/cli and generate a new project, this is what fix my problem. |
The frustrating thing is that there is no automatic refresh even with |
@NetanelBasal Yes! It's freaking annoying having to re-run |
Actually the npm run build:watch and npm start are working as expected - when library code is changed the npm run build:watch will detect it and rebuild the codes. After that, npm start on the consumer application should refresh as well but there are few tricks: Library application:
Consumer application:
Now both lib and consumer app are ready and will refresh if there are any code changes. Try to change some codes in lib, you should see the console is rebuilding instantly. After few seconds, consumer app will kick in by restarting the app and finally browser refresh. Whole process is fully automated. Hope this help. |
OK, thanks, we will check it out. By the way, this thread needs to be added to the README file. |
@NetanelBasal, @daslaf Playground is coming soon with #146 👍 |
In my case my consuming app brakes when it tries to bring css and js from assets of library. |
I had the same problem from last 2 days. |
Hi @jvandemo ,
I known this issue was raised before in #113 but looks like this problem is happened again in the latest Angular CLI. Below is the version I am using:
Node - 6.11.2
Npm - 5.3.0
Angular cli - 1.3.0
How to reproduce:
Below is the src/tsconfig.app.json content:
I am not sure I missed any things else. I have a second environment which is working correctly: Node 6.10.0, Npm 5.3.0, Angular Cli 1.0.2.
Below is the screen shot of the error. Any clue?
Thanks.
The text was updated successfully, but these errors were encountered: