x)- [x] bug report -> please search issues before submitting
- [ ] feature request
@angular/cli: 1.0.4
node: 6.10.0
os: darwin x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.4
@angular/compiler-cli: 4.1.3
ng new testAppsh build.shnpm link simple-ui-lib's /distnpm link simple-ui-libimport { BoxModule } from 'simple-ui-lib';BoxModule to the imports in testApp's app modulecompiler.es5.js:1540 Uncaught Error: Unexpected value 'BoxModule' imported by the module 'AppModule'. Please add a @NgModule annotation.
at syntaxError (http://localhost:4200/vendor.bundle.js:29714:34)
at http://localhost:4200/vendor.bundle.js:42668:44
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/vendor.bundle.js:42651:49)
at JitCompiler._loadModules (http://localhost:4200/vendor.bundle.js:53804:66)
at JitCompiler._compileModuleAndComponents (http://localhost:4200/vendor.bundle.js:53763:52)
at JitCompiler.compileModuleAsync (http://localhost:4200/vendor.bundle.js:53725:23)
at PlatformRef_._bootstrapModuleWithZone (http://localhost:4200/vendor.bundle.js:5731:25)
at PlatformRef_.bootstrapModule (http://localhost:4200/vendor.bundle.js:5717:21)
at Object.116 (http://localhost:4200/main.bundle.js:117:124)
I'd assume that since this error spawns from both the recommended package setup, and a default new CLI application, that it should run with no errors right out of the box.
This works in 1.0.3, but breaks in 1.0.4. (Broken in 1.1.0-rc.0 as well.) Not sure if this is actually a bug, or some change in how Angular CLI expects outside modules to be built.
For details on using a linked library, please see this new developer story: https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/linked-library.md
Closing as answered by @clydin, guidance can be found at that link.
The link now gives a 404!
The link for 1.x can still be found at https://github.com/angular/angular-cli/wiki/1-x-stories-linked-library.
For 6.x we added the library creation functionality, and have a new story at https://github.com/angular/angular-cli/wiki/stories-create-library.
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._
Most helpful comment
For details on using a linked library, please see this new developer story: https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/linked-library.md