[BUG] Unexpected value. Please add a @NgModule annotation.
See original GitHub issueπ Bug report
Command (mark with an x
)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Not, this is a older problem, i reported previusly in angular/angular-cli#13006 without providing a repo.
Description
I receive a Unexpected value 'LayoutModule' error when building a library with a single NgModule dependency (one NgModule depends on other).π¬ Minimal Reproduction
This repo contains a minimal example of the issue: https://github.com/prodisign/bug-reporting
ng build rh
π₯ Exception or Error
------------------------------------------------------------------------------
Building entry point '@prodisign/rh/model/client'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: Unexpected value 'LayoutModule in /home/jdavidls/Proyectos/prodisign/experiments/prodisign-workspace/dist/prodisign/rh/client/prodisign-rh-client.d.ts' imported by the module 'ModelModule in /home/jdavidls/Proyectos/prodisign/experiments/prodisign-workspace/projects/prodisign/rh/model/client/src/ModelModule.ts'. Please add a @NgModule annotation.
An unhandled exception occurred: Unexpected value 'LayoutModule in /home/jdavidls/Proyectos/prodisign/experiments/prodisign-workspace/dist/prodisign/rh/client/prodisign-rh-client.d.ts' imported by the module 'ModelModule in /home/jdavidls/Proyectos/prodisign/experiments/prodisign-workspace/projects/prodisign/rh/model/client/src/ModelModule.ts'. Please add a @NgModule annotation.
See "/tmp/ng-1Uj8ei/angular-errors.log" for further details.
π Your Environment
Angular CLI: 8.3.18
Node: 10.15.3
OS: linux x64
Angular: 8.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.803.18
@angular-devkit/build-angular 0.803.18
@angular-devkit/build-ng-packagr 0.803.18
@angular-devkit/build-optimizer 0.803.18
@angular-devkit/build-webpack 0.803.18
@angular-devkit/core 8.3.18
@angular-devkit/schematics 8.3.18
@angular/cli 8.3.18
@ngtools/webpack 8.3.18
@schematics/angular 8.3.18
@schematics/update 0.803.18
ng-packagr *5.7.1*
rxjs 6.4.0
typescript 3.5.3
webpack 4.39.2
Edit: In the repo, I am using a complex module disposition, doing use of secondary entrypoints. But other simplest dispositions throwns the same error.
Im reported the same issue at https://github.com/ng-packagr/ng-packagr/issues/1444.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unexpected value 'ButtonModule Please add a @NgModule ...
i have made a UI Library in Angular 8 and am using this library into my another custom library, But when am importing...
Read more >Javascript β Unexpected value 'β¦' imported by the module ...
imported by the module 'AppModule'. Please add a @NgModule annotation. I've tried: Clearing my npm cache; Re-installing all node modules; Forcing all AngularΒ ......
Read more >Unexpected value 'ButtonModule Please add a @NgModule ...
[Solved]-Unexpected value 'ButtonModule Please add a @NgModule annotation-angular.js ... You need to export and import the files explicitly. If it's a module fileΒ ......
Read more >Angular Error on build: 'Please add a @NgModule annotation'
ERROR in : Unexpected value 'SpreadSheetsModule in E:/misc/misc2/src/assets/spread/gc.spread.sheets.angular.11.1.3.d.ts' imported by theΒ ...
Read more >Angular Noob here - what does "Please add a @NgModule ...
Just a quick note: always check for dependencies when upgrading. In my experience, the error you got means, you haven't added a component...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@IgorMinar i am going to remove the ivy and ngcc labels as this is a bug in the VE metadata bundler.
This seems related to barrel files.
In
projects/prodisign/rh/client/src/public_api.ts
changeexport * from './layout
toexport * from './layout/index';
I am moving this to the FW repo as itβs a compiler bug.