Tesseract is not working in Nextjs 14 "use server " file it shows Error: Cannot find module '...(projectdirectory)/.next/worker-script/node/index.js' #911
Replies: 1 comment
-
|
Please read the documentation before posting. PDF support is discussed in the FAQ, and there are a half dozen Git Issues about the subject. This error message you posted looks completely self-explanatory--the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i am trying to build project where i need to extract text from images, but tesseract module is causing error and only working on client side
`import {createWorker} from 'tesseract.js';
export const imgToText = async () =>{
//const converter = await createWorker('eng')
const worker = await createWorker('eng',1,{workerPath: "./node_modules/tesseract.js/src/worker-script/node/index.js"});
try {
const img = "/fake.png"
const text = await worker.recognize(img);
console.log(text.data.text);
return text.data.text;
} catch (error) {
console.log("image extraction error", error);
throw error;
} finally {
await worker.terminate();
}
}`
i am i using api route to send the extracted text to server side for further processing,
and i have futher more question:
1: Can this tesseract read files images directly from the aws s3 bucket ? with its buffer blob?.
2. How does pdf with scanned images process in tesseract?
help required, in this problem thank you!
Beta Was this translation helpful? Give feedback.
All reactions