You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { PDFPageDrawImageOptions } from 'pdf-lib/src/api/PDFPageOptions';
should have been import { PDFPageDrawImageOptions } from 'pdf-lib';
And this confusion was created due to the src folder being available in the installed package. Not sure if it a good design, but I think the src folder shouldn't be included in npm releases.
I found the above issue only when I manually deleted the node_modules/pdf-lib/src folder.
What were you trying to do?
run
tsc
after importingpdf-lib
into my node projectHow did you attempt to do it?
npm i pdf-lib@latest
import { PDFDocument } from 'pdf-lib';
What actually happened?
Compilation failed with errors:
What did you expect to happen?
Compile successfully.
How can we reproduce the issue?
I'm using this
tsconfig.json
Version
1.17.1
What environment are you running pdf-lib in?
Node
Checklist
Additional Notes
in
pdf-lib
'stsconfig.json
,"moduleResolution"
is configured as"node"
, but the relative imports to project root are used, like:'src/api/colors'
(see: https://github.com/Hopding/pdf-lib/blob/master/src/api/PDFPageOptions.ts)I'm using
node
moduleResolution in my project andpdf-lib
seems to followclassic
moduleResolution strategy. Is there a way out to solve this issue?The text was updated successfully, but these errors were encountered: