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

pdfmake error in Vite + React #2718

Open
yeshua-aguilar opened this issue Apr 24, 2024 · 0 comments
Open

pdfmake error in Vite + React #2718

yeshua-aguilar opened this issue Apr 24, 2024 · 0 comments

Comments

@yeshua-aguilar
Copy link

there is a bug with the pdfmake and vfs_fonts dependency. And it is that at the time of compiling in Vite to pass it to production, there is an error that detects that it does not export an object pdfMake. Since Vite copies it into ES modules, it does not detect it.

The problems with pdfmake and vfs_fonts, it is likely that the error is related to the fact that I am using libraries that are written as CommonJS modules, while Vite expects ES modules.

Vite has built-in support for CommonJS modules, but there may be problems with certain libraries that use CommonJS-specific features that are not compatible with ES modules.

This error means that Vite is trying to import vfs_fonts as an ES module, but vfs_fonts is a CommonJS module and does not have a default export.

Translated with DeepL.com (free version)

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

2 participants