angular-cli: Angular 10 throw warning when using path alias
🐞 bug report
Affected Package
The issue is caused by package @angular/~10.0.14Is this a regression?
NoDescription
WARNING in src\app\users\user.component.ts depends on '@user/shared/selectors/selector'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
I’m using @user/shared/selectors/selector to shorten the import path
In tsconfig.base.json
"paths": {
"@user/*": ["src/app/user/*"]
},
🌍 Your Environment
@angular-devkit/architect 0.1000.8
@angular-devkit/build-angular 0.1000.8
@angular-devkit/build-optimizer 0.1000.8
@angular-devkit/build-webpack 0.1000.8
@angular-devkit/core 10.0.8
@angular-devkit/schematics 10.0.8
@angular/cdk 10.1.3
@angular/cli 10.0.8
@angular/material 10.1.3
@ngtools/webpack 10.0.8
@schematics/angular 10.0.8
@schematics/update 0.1000.8
rxjs 6.6.2
typescript 3.9.7
webpack 4.43.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 15
Commits related to this issue
- fix(@angular-devkit/build-angular): handle undefined descriptionFileData Closes #18631 — committed to angular/angular-cli by alan-agius4 4 years ago
- fix(@angular-devkit/build-angular): handle undefined descriptionFileData Closes #18631 (cherry picked from commit 09cfb29c0747f82db105acf738246536ce3dc3c3) — committed to angular/angular-cli by alan-agius4 4 years ago
This should be fixed in @angular-devkit/build-angular 0.1001.4
This seems like a bug but we’ll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?
You can read here why this is needed. A good way to make a minimal repro is to create a new app via
ng new repro-app
and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
@alan-agius4 my apologies for taking so long to create a reproduced example as you kindly asked, I’ve been very busy.
github.com/BenRacicot/alias-not-found-repro
not found
build-angular
to “@angular-devkit/build-angular”: “~0.1000.4” install and run to see them work as usualNotes: Just an observation, the error:
seems to be pointing to the compiled file. (with those line numbers) Is that right? So it would seem that aliased deps are not making it into the compiled file.