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 project with this library shows warning during build / serve

See original GitHub issue

What I observed? I noticed this behavior only after upgrading angular application to version 10. Not sure if it’s really harmful, but thought I would bring this to community’s attention. The library seems to be working just fine (as before the upgrade)

STR / How I got there? Steps to reproduce the behavior:

  1. upgrade an existing project that uses this library to version 10
  2. run ng build, ng build --prod, or ng serve command
  3. A warning is logged about this library:
WARNING in D:\Projects\NgUI\node_modules\angular-oauth2-oidc\__ivy_ngcc__\fesm2015\angular-oauth2-oidc.js depends on js-sha256. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

link from the warning message: https://angular.io/guide/build#configuring-commonjs-dependencies

ng version (from within project)

...\...\NgApplication>ng version

     _                      _                 ____ _     ___ 
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | | 
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | | 
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.0.0
Node: 12.18.1
OS: win32 x64

Angular: 10.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.0
@angular-devkit/build-angular     0.1000.0
@angular-devkit/build-optimizer   0.1000.0
@angular-devkit/build-webpack     0.1000.0
@angular-devkit/core              10.0.0
@angular-devkit/schematics        10.0.0
@ngtools/webpack                  10.0.0
@schematics/angular               10.0.0
@schematics/update                0.1000.0
rxjs                              6.5.5
typescript                        3.9.5
webpack                           4.43.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
manfredsteyercommented, Jun 29, 2020

Thanks for pointing this out. The good message is, this is only an optical issue: This is because js-sha256 is a tiny lib (9 K) which cannot really be optimized b/c it only contains one function we need all the time.

I will investigate how to make this warning disappear.

0reactions
8jigarpatelcommented, Jul 1, 2020

Just an update on this one: I no longer see this warning after upgrading this library to its latest version (10.0.1) as of now. https://www.npmjs.com/package/angular-oauth2-oidc/v/10.0.1

Angular app has also been migrated to latest version.

ng version (from within project)

...\...\NgApplication>ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.0.0
Node: 12.18.1
OS: win32 x64

Angular: 10.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.0
@angular-devkit/build-angular     0.1000.0
@angular-devkit/build-optimizer   0.1000.0
@angular-devkit/build-webpack     0.1000.0
@angular-devkit/core              10.0.0
@angular-devkit/schematics        10.0.0
@angular/cdk                      10.0.1
@angular/cli                      10.0.0
@angular/material                 10.0.1
@ngtools/webpack                  10.0.0
@schematics/angular               10.0.0
@schematics/update                0.1000.0
rxjs                              6.5.5
typescript                        3.9.5
webpack                           4.43.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Identify and Fix Build and Deployment Errors in Your Angular ...
In this guide, you will learn how to spot some of the most common build and deployment errors and how to resolve them...
Read more >
Angular CLI Error: The serve command requires to be run in ...
This error occurs when the project you are running is not an angular project. Though you have downloaded an angular project ...
Read more >
ng build - Angular
Option Description Value Type Default Value ‑‑aot Build using Ahead of Time compilation. boolean true ‑‑base‑href Base url for the application being built. string ‑‑delete‑output‑path Delete...
Read more >
Creating libraries - Angular
The public API for your library is maintained in the public-api.ts file in your library folder. Anything exported from this file is made...
Read more >
Angular compiler options
Configuration inheritance with extendslink. Like the TypeScript compiler, the Angular AOT compiler also supports extends in the angularCompilerOptions section ...
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