From 9f22aae57c4419b55d5b810c7c9d0545f2c90977 Mon Sep 17 00:00:00 2001
From: Thuc Pham <51660321+thucpn@users.noreply.github.com>
Date: Wed, 23 Oct 2024 11:48:22 +0700
Subject: [PATCH] fix: unable to resolve unpdf in nextjs (#1369)

---
 .changeset/twenty-camels-burn.md | 5 +++++
 packages/llamaindex/src/next.ts  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 .changeset/twenty-camels-burn.md

diff --git a/.changeset/twenty-camels-burn.md b/.changeset/twenty-camels-burn.md
new file mode 100644
index 000000000..c997d2183
--- /dev/null
+++ b/.changeset/twenty-camels-burn.md
@@ -0,0 +1,5 @@
+---
+"llamaindex": patch
+---
+
+fix: unable to resolve unpdf in nextjs
diff --git a/packages/llamaindex/src/next.ts b/packages/llamaindex/src/next.ts
index c59206071..8e44e479c 100644
--- a/packages/llamaindex/src/next.ts
+++ b/packages/llamaindex/src/next.ts
@@ -31,7 +31,6 @@ export default function withLlamaIndex(config: any) {
     webpackConfig.resolve.alias = {
       ...webpackConfig.resolve.alias,
       "@google-cloud/vertexai": false,
-      unpdf: false,
     };
     // Following lines will fix issues with onnxruntime-node when using pnpm
     // See: https://github.com/vercel/next.js/issues/43433
@@ -39,6 +38,7 @@ export default function withLlamaIndex(config: any) {
       "onnxruntime-node": "commonjs onnxruntime-node",
       sharp: "commonjs sharp",
       chromadb: "commonjs chromadb",
+      unpdf: "commonjs unpdf",
     });
     return webpackConfig;
   };
-- 
GitLab