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 11 production build warnings

See original GitHub issue

When we do our angular 11 production build of the latest version 2.3.1 I get a whole bunch of warnings due to the inclusion of this library:

Build at: 2021-04-20T22:04:53.426Z - Hash: 014c2a27e7f0ef06ac83 - Time: 528039ms

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/parse-float'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/map'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/symbol'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/starts-with'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/map'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/for-each'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/filter'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/slice'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/object/define-property'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/object/define-properties'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/object/keys'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/slicedToArray'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/reflect/get-prototype-of'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/reflect/apply'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/parse-int'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js/get-iterator-method'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js/get-iterator'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/array/is-array'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/values'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/reflect/delete-property'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/get'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/fill'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/reverse'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/index-of'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/array/from'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/includes'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/some'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/toConsumableArray'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/getPrototypeOf'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/possibleConstructorReturn'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/inherits'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/reflect/construct'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/trim'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/bind'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/promise'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/every'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/reduce'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/instance/concat'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/createClass'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/defineProperty'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/helpers/asyncToGenerator'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/core-js-stable/date/now'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Warning: /node_modules/canvg/lib/index.es.js depends on '@babel/runtime-corejs3/regenerator'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

I have tried to include the jsPDF and canvg libraries in the allowedCommonJsDependencies in the angular.json file, but the warnings persist. like so:

"options": {
            "allowedCommonJsDependencies": [
                        "jspdf",
                        "canvg"
            ]   
}

When will jsPDF support angular es module build instead of the commonJS module build?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:6

github_iconTop GitHub Comments

18reactions
Santoshahcommented, May 12, 2021

For me I include this lines to my angular.json file :
Thanks @HackbrettXXX reference link

"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    "allowedCommonJsDependencies": [
              "raf",
              "@babel/runtime-corejs3"
    ]
    // ...
  }
  // ...
},
8reactions
weiliescommented, Jun 19, 2021

Thanks @Santoshah , managed to suppressed tons of warning messages after set the provided setup. But according to the warning message “Warning: /home/…component.ts depends on ‘<SOMEBODY-PACKAGE>’. CommonJS or AMD dependencies can cause optimization bailouts.”

Correct me if i am wrong, it’s tries to warn the developer on the optimization but the change of adding the package into “allowedCommonJsDependencies” parameter is just suppressed the warning message and not optimize the build time, am i right? If my assumption is correct, is there a way to optimzie the import, build time instead of just suppress the error message?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 11 production build warnings · Issue #3144 - GitHub
When we do our angular 11 production build of the latest version 2.3.1 I get a whole bunch of warnings due to the...
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 >
Angular 12 production build warning (MDB4 12)
Expected behavior. Upgrading a project from Angular 10 (to Angular 11 and then) to Angular 12 and making a production build. Actual behavior....
Read more >
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 change build warnings to errors - Stack Overflow
angular CLI change build warnings to errors ... and the compiler can produce object code for it, but something ... Mar 4, 2021...
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