-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
PDFKit doesn't work with ESM #1491
Comments
I recommend just downloading a font from somewhere and passing it to the constructor.
This allowed me to at least be unblocked on using this library since there's not really any other good options. |
I just switched to pdf-lib. It works. |
This "hack" from @lramos15 worked for me. Its not the best solution but way better than no solution. I was already getting crazy with this problem. Thank you very much for this! Hope this library gets a support or workaround for ESM someday.. |
I settled on https://pdfme.com/ in case people are looking for other suggestions too. It's more of a template filler than a full blown pdf kit but works decently well and is updated |
For node, currently it does not work with esm. |
Thank you, it solved my problem hahaha |
Bug Report
Description of the problem
In modern projects that rely on ES modules PDFKit cannot work due to missing
__dirname
global variable.During development of my SvelteKit app I could use PDFKit library, but once in production mode the app will crash with:
Code sample
Your environment
The text was updated successfully, but these errors were encountered: