question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 10 throw warning when using path alias

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/~10.0.14

Is this a regression?

No

Description

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:15

github_iconTop GitHub Comments

2reactions
alan-agius4commented, Oct 1, 2020

This should be fixed in @angular-devkit/build-angular 0.1001.4

2reactions
alan-agius4commented, Sep 7, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 10 path aliases issue - typescript
I am trying to use path aliases for services & components so that I can avoid messy imports. My services are under src/app/services...
Read more >
Schematics for libraries
In your library project's package.json file, add a "schematics" entry with the path to your schema file. The Angular CLI uses this entry...
Read more >
Top 18 Most Common AngularJS Developer Mistakes
In this article you will learn about most common AngularJS developer ... a new $digest cycle is fired (up to a maximum of...
Read more >
sass-loader - webpack - JS.ORG
The presented code will throw webpack warning instead logging. To ignore unnecessary warnings you can use the ignoreWarnings option. webpack.config.js module.
Read more >
Node.js v19.3.0 Documentation
Building; Linking to libraries included with Node.js ... WARNING: This does not throw an AssertionError in legacy assertion mode! ... Added in: v10.0.0....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found