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

after migrating to VITE from CREATE-REACT-APP, I am getting r3.writeFileSync is not a function error on export pdf #3720

Closed
Hari-sankoju opened this issue Mar 30, 2024 · 2 comments

Comments

@Hari-sankoju
Copy link

I am using "jspdf" version "2.3.1".
My code working fine with CRETE-REACT-APP, but after migrating to VITE, while exporting to pdf I am getting r3.writeFileSync is not a function error.
After some google I understood that fs is externalized in VITE and jsPDF is using require('fs') method of loading fs library.

I tried providing aliases and node module polyfills but nothing is working. Please help me.

This is the error I am getting.
r3.writeFileSync is not a function
at v2.save (jspdf.js:5811:10)

@Hari-sankoju
Copy link
Author

@MrRio @Uzlopak - pls help me on this issue.

Copy link

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

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

No branches or pull requests

1 participant