Skip to content
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

Setting up fake worker failed #48

Open
nyominkhat opened this issue Oct 1, 2024 · 2 comments
Open

Setting up fake worker failed #48

nyominkhat opened this issue Oct 1, 2024 · 2 comments

Comments

@nyominkhat
Copy link

``after deployed on vercel

i got this error

Setting up fake worker failed: "Cannot find module '/var/task/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs"

and this is how i use

`import { pdfToPng } from "pdf-to-png-converter";

const convertPdfToImg = async (filePath: string, output: string) => {
const pngPage = await pdfToPng(filePath, {
viewportScale: 2.0,
outputFileMask: "buffer",
outputFolder: output,
});
return pngPage;
};

export default convertPdfToImg;
`

@dichovsky
Copy link
Owner

``after deployed on vercel

i got this error

Setting up fake worker failed: "Cannot find module '/var/task/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs"

and this is how i use

`import { pdfToPng } from "pdf-to-png-converter";

const convertPdfToImg = async (filePath: string, output: string) => { const pngPage = await pdfToPng(filePath, { viewportScale: 2.0, outputFileMask: "buffer", outputFolder: output, }); return pngPage; };

export default convertPdfToImg; `

It seems to be an issue with Vercel and its Node.js environment. Ensure that you're using Node.js version 18.0.0 or higher

@nyominkhat
Copy link
Author

``after deployed on vercel
i got this error
Setting up fake worker failed: "Cannot find module '/var/task/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs"
and this is how i use
import { pdfToPng } from "pdf-to-png-converter"; const convertPdfToImg = async (filePath: string, output: string) => { const pngPage = await pdfToPng(filePath, { viewportScale: 2.0, outputFileMask: "buffer", outputFolder: output, }); return pngPage; }; export default convertPdfToImg;

It seems to be an issue with Vercel and its Node.js environment. Ensure that you're using Node.js version 18.0.0 or higher

Thank you @dichovsky,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants