foliojs / pdfkit

A JavaScript PDF generation library for Node and the browser
http://pdfkit.org/
MIT License
9.92k stars 1.16k forks source link

Use Path.join() instead - Error: ENOENT: no such file or directory, open '/...//data/Helvetica.afm' #1516

Open alisha-monark opened 6 months ago

alisha-monark commented 6 months ago

https://github.com/foliojs/pdfkit/blob/b35c6f91799b969e570222f19ca4ef357c480aff/lib/font/standard.js#L23

This is giving me an error when trying to deploy to AWS Lambda using SST because of an extra slash in the path:

Error: ENOENT: no such file or directory, open '/var/task/packages/functions/src//data/Helvetica.afm'

notice the extra slash / after src.

If we use path.join() instead of + that would fix the problem

laurent512 commented 4 months ago

please solve

Ciaran0 commented 4 months ago

Any workaround?

thehashrocket commented 3 days ago

Still have the same issue here. Error generating PDF: Error: ENOENT: no such file or directory, open '~/.next/server/vendor-chunks/data/Helvetica.afm'