-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
Hello, my issue is similar to #2846 I have an application created with create-react-app --template typescript
I use:
"react-app-rewired": "^2.1.6",
"jspdf": "^2.1.1"
My custom webpack configuration
module.exports = function override(config, env) {
if (!config.externals) {
config.externals = {};
}
config.externals = {
...config.externals,
canvg: "canvg",
html2canvas: "html2canvas",
dompurify: "dompurify",
};
return config;
};
And code:
import { jsPDF } from "jspdf";
doc.html(<p>Hello world!</p>", {
callback: function (doc) {
doc.save('doc.pdf');
}
});
And this is what I get:
Uncaught (in promise) Error: Could not load dompurify: Error: Could not load
They are both present in my node_modules
folder.
PDF is generated but completely blank.
Thanks
AnjaneyuluBatta505
Metadata
Metadata
Assignees
Labels
No labels