Skip to content

PDFLoader not working #615

@neebdev

Description

@neebdev

[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/or ReadableStream); please use a legacy-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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions