Libraries added to other Library with npm install <folder> does not compile
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x
)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Windows: 10 1709
node: v8.9.4
npm: 5.6.0
ng: 6.2.3
@angular-devkit/build-ng-packagr: 0.8.2
ng-packagr: 4.2.0
Repro steps
Create two library modules with the ng cli tool, in separate work spaces (module a and b).
Build module b.
Use npm to reference module b build output form module a using the folder path. (npm install <pathOtherModuleBuildOutput>
.)
Npm creates a symbolic link when you do this.
Add module b as an import to module a.
build module a.
I’ve created a small repository that reproduces the issue here https://github.com/KrauseStefan/ng-packagr-symlink-issue
The log given by the failure
Building Angular Package
Building entry point 'a'
Compiling TypeScript sources through ngc
BUILD ERROR
Error during template compile of 'NgModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
: Unexpected value 'BModule in C:/git/symlink-error/subModule/dist/b/b.d.ts' imported by the module 'AModule in C:/git/symlink-error/mainModule/projects/a/src/lib/a.module.ts'. Please add a @NgModule annotation.
Error: Error during template compile of 'NgModule'
Function calls are not supported in decorators but 'ɵmakeDecorator' was called.
: Unexpected value 'BModule in C:/git/symlink-error/subModule/dist/b/b.d.ts' imported by the module 'AModule in C:/git/symlink-error/mainModule/projects/a/src/lib/a.module.ts'. Please add a @NgModule annotation.
at Object.<anonymous> (C:\git\symlink-error\mainModule\node_modules\ng-packagr\lib\ngc\compile-source-files.js:40:68)
at Generator.next (<anonymous>)
at C:\git\symlink-error\mainModule\node_modules\ng-packagr\lib\ngc\compile-source-files.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\git\symlink-error\mainModule\node_modules\ng-packagr\lib\ngc\compile-source-files.js:3:12)
at Object.compileSourceFiles (C:\git\symlink-error\mainModule\node_modules\ng-packagr\lib\ngc\compile-source-files.js:17:12)
at Object.<anonymous> (C:\git\symlink-error\mainModule\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:31:32)
at Generator.next (<anonymous>)
at C:\git\symlink-error\mainModule\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:7:71
at new Promise (<anonymous>)
Desired functionality
Building libraries depending on other libraries through a npm install created symlink
Mention any other details that might be useful
It will be great for this to work in order to prevent excessive copying of files. I’m looking into creating a build environment where we are able to build our modules separately, I would like to maintain as fast build speeds as possible, this means that I would also like ng build --watch
to still function but not be active on all modules. Symlinks with npm install <folder> is my first shot at this.
I belvie there should be a flag for library build just like there is for final browser builds, therefor I file this as a bug.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6
Thank you, I am a little embarrassed that I missed that one, thank you.
The status is still need more information is this still the case @alan-agius4 ?