Legal-semantic-search app error

Hello! I’m trying to run the legal-semantic-search app locally, but after I get it installed via npx and run all the relevant commands, it seems I get an error during bootstrapping. Specifically, the one below:

(pinecone) (base) PS C:\Users\Matt\legal-semantic-search> npm run dev

> Legal semantic search sample app@0.1.0 dev
> next dev

  ▲ Next.js 14.2.3
  - Local:        http://localhost:3000
  - Environments: .env

 ✓ Starting...
'pnpm' is not recognized as an internal or external command,
operable program or batch file.
 ✓ Ready in 1513ms
 ○ Compiling / ...
 ✓ Compiled / in 1142ms (502 modules)
 GET / 200 in 1437ms
 ✓ Compiled in 310ms (245 modules)
 ○ Compiling /api/bootstrap ...
 ✓ Compiled /api/bootstrap in 579ms (695 modules)
 ✓ Compiled /api/ingest in 108ms (697 modules)
Running bootstrapping procedure against Pinecone index: legal-semantic-search
Running bootstrapping procedure against Pinecone index: legal-semantic-search
Pinecone index does not exist or has no vectors in it - bootstrapping
Pinecone index does not exist or has no vectors in it - bootstrapping
Unknown file type: db.json
Unknown file type: db.json
Error during bootstrap procedure: TypeError: Cannot read properties of undefined (reading '0')
    at VoyageEmbeddings.embedDocuments (webpack-internal:///(rsc)/./node_modules/@langchain/community/dist/embeddings/voyage.js:92:46)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async $$ACTION_1 (webpack-internal:///(rsc)/./src/app/services/bootstrap.ts:148:28)
    at async POST (webpack-internal:///(rsc)/./src/app/api/ingest/route.ts:16:5)
    at async C:\Users\Matt\legal-semantic-search\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:53446
    at async e_.execute (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:44747)
    at async e_.handle (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:54700)
    at async doRender (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1377:42)
    at async cacheEntry.responseCache.get.routeKind (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1599:28)
    at async DevServer.renderToResponseWithComponentsImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1507:28)
    at async DevServer.renderPageComponent (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1924:24)
    at async DevServer.renderToResponseImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1962:32)
    at async DevServer.pipeImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:920:25)
    at async NextNodeServer.handleCatchallRenderRequest (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\next-server.js:272:17)
    at async DevServer.handleRequestImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:816:17)
    at async C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\dev\next-dev-server.js:339:20
    at async Span.traceAsyncFn (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\trace\trace.js:154:20)
    at async DevServer.handleRequest (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\dev\next-dev-server.js:336:24)
    at async invokeRender (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\router-server.js:174:21)
    at async handleRequest (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\router-server.js:353:24)
    at async requestHandlerImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\router-server.js:377:13)
    at async Server.requestListener (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\start-server.js:141:13)
 POST /api/ingest 200 in 40874ms
 POST /api/bootstrap 200 in 41870ms
Error during bootstrap procedure: TypeError: Cannot read properties of undefined (reading '0')
    at VoyageEmbeddings.embedDocuments (webpack-internal:///(rsc)/./node_modules/@langchain/community/dist/embeddings/voyage.js:92:46)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async $$ACTION_1 (webpack-internal:///(rsc)/./src/app/services/bootstrap.ts:148:28)
    at async POST (webpack-internal:///(rsc)/./src/app/api/ingest/route.ts:16:5)
    at async C:\Users\Matt\legal-semantic-search\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:53446
    at async e_.execute (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:44747)
    at async e_.handle (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:54700)
    at async doRender (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1377:42)
    at async cacheEntry.responseCache.get.routeKind (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1599:28)
    at async DevServer.renderToResponseWithComponentsImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1507:28)
    at async DevServer.renderPageComponent (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1924:24)
    at async DevServer.renderToResponseImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:1962:32)
    at async DevServer.pipeImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:920:25)
    at async NextNodeServer.handleCatchallRenderRequest (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\next-server.js:272:17)
    at async DevServer.handleRequestImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\base-server.js:816:17)
    at async C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\dev\next-dev-server.js:339:20
    at async Span.traceAsyncFn (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\trace\trace.js:154:20)
    at async DevServer.handleRequest (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\dev\next-dev-server.js:336:24)
    at async invokeRender (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\router-server.js:174:21)
    at async handleRequest (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\router-server.js:353:24)
    at async requestHandlerImpl (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\router-server.js:377:13)
    at async Server.requestListener (C:\Users\Matt\legal-semantic-search\node_modules\next\dist\server\lib\start-server.js:141:13)

Any help would be greatly appreciated. Thanks!

1 Like

Hi @slomka.matthew and thank you for your question!

The error indicates that you need one of the Node.js package managers, pnpm installed.

PNPM is an alternative to npm and yarn, and it’s performance-minded in that it implements a shared cache of dependencies on your machine to avoid unnecessary or redundant downloads.

It’s also favored by certain providers such as Vercel, where we deploy most of our full stack JavaScript applications.

Here’s the official installation docs for PNPM - please install it and try again and let me know how it goes.

Best,
Zack

1 Like