-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
angular commonjs dependencies warning #80
Comments
Hi @alexladeira! |
Hi, I'm using angular 13 with pdfmake-wrapper 2.1.2. I am importing the dependencies in one of my ts files like this: import { Canvas, Columns, Line, PdfMakeWrapper, Rect, Stack, Table, Txt } from 'pdfmake-wrapper'; and starting as pdf = new PdfMakeWrapper(); |
Have you added the fonts to use?
You can check how to create your first PDF here. |
Yes, I added this line inside the constructor method (I'm using Typescript) |
Updating with more information, I create an repo on my account - https://github.com/alexladeira/angular-pdfmake-wrapper. It's not exactly my setup, because angular is on the last version, but when you run "npm run start" the same problem occurs. Thanks for your help. |
This is because pdfmake uses commonjs dependencies. Angular prefers ECMAScript. The problem you may encounter, is that your application will be larger and slower. It's possible to ignore this warning, but not recommended. My recommendation would be to use the pdfmake-wrapper in your backend solution if this one is part of the nodejs ecosystem. |
Hello, your backend is in Java, so what you suggests can't be done in your case, as far as I know. Anyway, thanks for your tip. |
Hi, I am using this library to generate PDF documents, and when I run my app this message appears on the console:
Warning: .../node_modules/pdfmake-wrapper/lib/pdfmake-wrapper.js depends on 'pdfmake/build/pdfmake'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
This link from the angular.io is just a way to disable the warning, it does not resolve it. Do you have any hint how to resolve it? Thanks in advice.
The text was updated successfully, but these errors were encountered: