Skip to content
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

PDF failed to be generated under react-scripts5.0, warning message related to sub-dependency html2canvas #3356

Closed
GdayRui opened this issue Jan 7, 2022 · 7 comments

Comments

@GdayRui
Copy link

GdayRui commented Jan 7, 2022

Hi there,
My PDF generation got failed after react-scripts upgraded to 5.0.0. The error messages are copied below:

WARNING in ./node_modules/html2canvas/dist/html2canvas.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'C:\Users\RuiLi\Development\IDU_frontend\node_modules\src\css\property-descriptors\overflow.ts'

webpack 5.65.0 compiled with 113 warnings in 179878 ms

All these 113 warnings related to html2canvas.
I have checked html2canvas GitHub, the author has fixed this issue in the latest version (V1.4.0) niklasvh/html2canvas#2706

I wonder any chance or when it is possible to get this issue fixed in jsPDF?
Many thanks!

@GdayRui GdayRui changed the title PDF failed to be generated under react-scripts, warning message related to html2canvas package PDF failed to be generated under react-scripts5.0, warning message related to sub-dependency html2canvas Jan 7, 2022
@rafaewaqarqazi
Copy link

I am also getting same warnings using [email protected]

@HackbrettXXX
Copy link
Collaborator

Please provide a pull request.

@GdayRui
Copy link
Author

GdayRui commented Jan 20, 2022

This source-map issue of html2canvas is still existing in the latest version (1.4.0), also reported by others niklasvh/html2canvas#2789
Pending new release.

@GdayRui
Copy link
Author

GdayRui commented Feb 8, 2022

Hi @HackbrettXXX , I have found the html2canvas's author has released version(1.4.1) 17 days ago, and I have tested it, the source map issue has been resolved.
Could you update this dependency in the next release pls? Thanks.

@HackbrettXXX
Copy link
Collaborator

The dependency is specified with ^1.0.0-rc.5, so when performing a fresh install, it will install html2canvas 1.4.1. You might need to update you package-lock.json/yarn.lock file.

@GdayRui
Copy link
Author

GdayRui commented Feb 9, 2022

@HackbrettXXX Thanks a lot to tell~

@farukhpatel
Copy link

I installed html2canvas newest version but pdf not generating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants