Use Angular CLI and ng-packagr for local development and CI servers
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
Not sure the packagr is actually compatible with the cli in the same repo as described in the readme. I realize that this issue is related to another repo, but this was the only place to file an issue. I believe it is related to how the cli resolves modules slightly differently than tsc (at least for modules outside the baseUrl).
How To Reproduce
When attempting to use the repo from the readme, the ng serve command fails with ERROR in src/app/app.component.ts(3,28): error TS2307: Cannot find module '@my/lib'. src/app/app.module.ts(7,29): error TS2307: Cannot find module '@my/lib'.
Expected Behaviour
It should be able to resolve lib
Version Information
"dependencies": {
"@angular/common": "~5.0.0",
"@angular/compiler": "~5.0.0",
"@angular/core": "~5.0.0",
"@angular/forms": "~5.0.0",
"@angular/http": "~5.0.0",
"@angular/platform-browser": "~5.0.0",
"@angular/platform-browser-dynamic": "~5.0.0",
"@angular/router": "~5.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.5.0",
"@angular/compiler-cli": "~5.0.0",
"@angular/language-service": "~5.0.0",
"@types/jasmine": "~2.6.0",
"@types/node": "~8.0.0",
"codelyzer": "~4.0.0",
"cpr": "^3.0.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "1.5.0",
"protractor": "~5.2.0",
"rimraf": "^2.6.1",
"ts-node": "~3.3.0",
"tslint": "~5.8.0",
"typescript": "~2.5.2"
}
Update: For anyone else facing this issue, I believe it is being tracked here in the cli project and has been assigned to someone. - https://github.com/angular/angular-cli/issues/8308 Seems it is looking in node_modules to module resolution and ignoring all other path settings and alias’ such as those in tsconfig or webpack (according to the issue).
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top GitHub Comments
@jonesmac Exactly! More of a general rewrite of the README how you used the demo project. That will be super-cool!
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
This action has been performed automatically by a bot.