Closed thantos closed 1 year ago
I'll be on it. Sorry for the delay.
Can you try the prepatch and tell me if it fixes the issue? Version is: 1.19.13-0
@thantos Did the prepatch fix the issue? I'll be releasing version 1.19.13 now.
Haven't had a chance to try yet, will try later today.
I released version 1.19.13. I decided to embark the change, as the current version is broken anyway. Not much risk to break anything, right?
Assuming this is related:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'color.js' imported from /Users/.../node_modules/@cantoo/pdf-lib/es/api/colors.js
Ah, indeed. Let me fix that
Fixed in 1.19.14
Its working for me so far, thanks for the fix!
What were you trying to do?
Use pdf-lib in node 18 with esm, esbuild (esm) to bundle, and run locally with nodejs in esm.
How did you attempt to do it?
What actually happened?
Outcome of the import patterns in order
What did you expect to happen?
I expect at least import pattern 1 to work.
How can we reproduce the issue?
index.mjs:
Version
What environment are you running pdf-lib in?
Node, Other
Checklist
Additional Notes
For typescript to recognize the es/index.js import, it needs a package.json with
{ type: "module" }
in the directory at a minimum.For node, it needs the new "exports" block in package.json
Additionally, the es/* directory imports need to be updated to use full file paths.
Is fixed by changing es/index.js to:
But needs to be repeated all of the way down.
My current resolution is to downgrade back to 1.17, which does not have this issue.