jsPDF 2.0.0 - Critical dependency: the request of a dependency is an expression
See original GitHub issuePackages: Node: 10.14.2 Angular: 10.0 jsPDF: 2.0.0
Problem: I just updated jsPDF from 1.5.3 to 2.0.0 in my Angular 10.0 project and suddenly experience following warning during building:
WARNING in ./node_modules/jspdf/dist/jspdf.umd.min.js 195:240-254
Critical dependency: the request of a dependency is an expression
Usage:
import { jsPDF } from "jspdf";
import html2canvas from 'html2canvas';
public savePDF(fileName: string) {
/* tslint:disable */
window['html2canvas'] = html2canvas;
/* tslint:enable */
const jspdf = new jsPDF({
orientation: 'p',
unit: 'pt',
format: 'a4'
});
const canvas = this.canvas.nativeElement;
try {
jspdf.html(canvas, {
html2canvas: {
allowTaint: true,
useCORS: true,
scale: 600 / canvas.scrollWidth
},
callback: async (doc) => {
doc.save(`${fileName}.pdf`);
console.log('Success');
}
});
} catch (error) {
console.error(error);
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:32
- Comments:32
Top Results From Across the Web
jsPDF 2.0.0 - Critical dependency: the request of a ... - GitHub
Packages: Node: 10.14.2 Angular: 10.0 jsPDF: 2.0.0 Problem: I just updated jsPDF from 1.5.3 to 2.0.0 in my Angular 10.0 project and suddenly ......
Read more >Webpack - Critical dependency: the request of a dependency ...
When a library uses variables or expressions in a require call (such as require('' + 'nodent') in these lines of ajv ), Webpack...
Read more >the request of a dependency is an expressio - You.com
Hi, I'm using treeviz with React 17 and I get error when build in the build server: Critical dependency: the request of a...
Read more >jspdf - npm
Start using jspdf in your project by running `npm i jspdf`. There are 1012 other projects in the npm registry using jspdf.
Read more >Bump jspdf from 1.5.3 to 2.3.1 (!8) - MPCDF Gitlab
#2865: Fix "Critical dependency: the request of a dependency is an expression" warning and loading of optional dependencies · #2872: Add support ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good to hear. Thanks.
I will prepare a new release next week.
I can add that also we found the below lines.
[ng] WARNING in ./node_modules/jspdf/dist/jspdf.umd.min.js 195:141-151 [ng] Critical dependency: the request of a dependency is an expression [ng] WARNING in ./node_modules/jspdf/dist/jspdf.umd.min.js 195:240-254 [ng] Critical dependency: the request of a dependency is an expression