I installed two npm packages in the Editor:
“pdfkit”: “0.13.0”
“stream-buffers”: “3.0.2”
Import statements I am using in the backend .mjs file should be fine:
import PDFDocument from ‘pdfkit’;
import { WritableStreamBuffer } from ‘stream-buffers’;
Yet the IDE still can’t find the modules:
Cannot find module ‘pdfkit’ or its corresponding type declarations.
Cannot find module ‘stream-buffers’ or its corresponding type declarations.
Here is my package.json file:
{
“name”: “your-project-name”,
“dependencies”: {
“pdfkit”: “0.13.0”,
“stream-buffers”: “3.0.2”
},
“type”: “module”
}
I have been stuck on this for days and am pulling my hair out. Why won’t they be imported?? What am I missing.
Let me know what more information you guys need to help a fella out.
Thanks everyone!
G