Skip to content

Commit e4a3b3b

Browse files
improve(pdf-loader): update error message to specify support for pdf-… (#9253)
Co-authored-by: Christian Bromann <[email protected]>
1 parent 0b23155 commit e4a3b3b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@langchain/community": patch
3+
---
4+
5+
improve(pdf-loader): update error message to specify support for pdf-parse v1 only

β€Žlibs/langchain-community/src/document_loaders/fs/pdf.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async function PDFLoaderImports() {
143143
} catch (e) {
144144
console.error(e);
145145
throw new Error(
146-
"Failed to load pdf-parse. Please install it with eg. `npm install pdf-parse`."
146+
"Failed to load pdf-parse. This loader currently supports pdf-parse v1 only. Please install v1, e.g. `npm install pdf-parse@^1` (v2 is not yet supported)."
147147
);
148148
}
149149
}

β€Žlibs/langchain-community/src/document_loaders/web/pdf.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async function PDFLoaderImports() {
128128
} catch (e) {
129129
console.error(e);
130130
throw new Error(
131-
"Failed to load pdf-parse. Please install it with eg. `npm install pdf-parse`."
131+
"Failed to load pdf-parse. This loader currently supports pdf-parse v1 only. Please install v1, e.g. `npm install pdf-parse@^1` (v2 is not yet supported)."
132132
);
133133
}
134134
}

0 commit comments

Comments
Β (0)