diff --git a/.changeset/perfect-pigs-decide.md b/.changeset/perfect-pigs-decide.md
new file mode 100644
index 0000000000000000000000000000000000000000..f3567a512065930e60f7eaa676a7888fb74e2c28
--- /dev/null
+++ b/.changeset/perfect-pigs-decide.md
@@ -0,0 +1,5 @@
+---
+"llamaindex": patch
+---
+
+fix: bundling issue with pnpm
diff --git a/packages/llamaindex/src/next.ts b/packages/llamaindex/src/next.ts
index a5dac67d11b11febf42b5ac70831455da61ed710..26d31735c1ea15591f6898c47b14ce43082c84b3 100644
--- a/packages/llamaindex/src/next.ts
+++ b/packages/llamaindex/src/next.ts
@@ -32,6 +32,12 @@ export default function withLlamaIndex(config: any) {
       "@google-cloud/vertexai": false,
       "groq-sdk": false,
     };
+    // Following lines will fix issues with onnxruntime-node when using pnpm
+    // See: https://github.com/vercel/next.js/issues/43433
+    webpackConfig.externals.push({
+      "onnxruntime-node": "commonjs onnxruntime-node",
+      sharp: "commonjs sharp",
+    });
     return webpackConfig;
   };
   return config;