-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
PDFLoader not working #615
Comments
solved by changing |
@neebdev hi, which environment are you running this on? Node? if so, which version |
Node v18.12.1 |
same error with |
I've opened a PR that will let you customise which build of pdfjs is used, see #622 |
Same problem on node 18.4, macos darwin |
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "UnknownErrorException: The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g.
Path2D
and/orReadableStream
); please use alegacy
-build instead.".] {code: 'ERR_UNHANDLED_REJECTION'
}
Usage:
import { PDFLoader } from "langchain/document_loaders";
export const run = async () => {
const loader = new PDFLoader("src/sample.pdf");
const docs = await loader.load();
console.log(docs);
};
run();
The text was updated successfully, but these errors were encountered: