tursodatabase / tursodatabase/libsql-client-ts
NextJS Server Actions Error: Unexpected identifier '__webpack_async_dependencies__'
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 576
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
I tried using libsql-client-ts to access a Turso database with both Prisma and Drizzle ORMs. When using these tools with libsql-client-ts I enountered errors with NextJS 14 Server Actions.
I raised an new issue with Prisma, however after also testing with Drizzle it seems the issue may be coming from libsql-client-ts.
I created a repository with a branch for each ORM:
Running the create invoice action locally will trigger the issue. It is within the actions.ts file and the action specifically is createInvoice.
There is some additional information available in the issue I raised with Prisma. Worth noting is that the action worked with Prisma after removing the libsql-client-ts driver adapter and running sqlite through a local db file.
Unhandled Runtime Error
Error: Unexpected identifier '__webpack_async_dependencies__'
Call Stack
(action-browser)/./app/lib/db.ts
/Users/asciant/Projects/nextjs-dashboard/.next/server/app/dashboard/invoices/create/page.js (476:1)
__webpack_require__
/Users/asciant/Projects/nextjs-dashboard/.next/server/webpack-runtime.js (33:42)
eval
webpack-internal:///(action-browser)/./app/lib/actions.ts (13:69)
(action-browser)/./app/lib/actions.ts
/Users/asciant/Projects/nextjs-dashboard/.next/server/app/dashboard/invoices/create/page.js (454:1)
Function.__webpack_require__
/Users/asciant/Projects/nextjs-dashboard/.next/server/webpack-runtime.js (33:42)
process.processTicksAndRejections
node:internal/process/task_queues (95:5)
async endpoint
node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fasciant%2FProjects%2Fnextjs-dashboard%2Fapp%2Flib%2Factions.ts%22%2C%5B%22createInvoice%22%5D%5D%5D&__client_imported__=true! (7:0)
async
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (38:479)
async tK
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (37:4768)
async ri
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (38:28770)
async doRender
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (1343:26)
async cacheEntry.responseCache.get.incrementalCache.incrementalCache
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (1503:28)
async DevServer.renderToResponseWithComponentsImpl
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (1411:28)
async DevServer.renderPageComponent
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (1763:24)
async DevServer.renderToResponseImpl
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (1801:32)
async DevServer.pipeImpl
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (854:25)
async NextNodeServer.handleCatchallRenderRequest
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/next-server.js (266:17)
async DevServer.handleRequestImpl
/Users/asciant/Projects/nextjs-dashboard/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/base-server.js (751:17)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by running the create invoice action at the provided local route, starting with app/lib/actions.ts and the createInvoice entry point. Compare the Prisma and Drizzle branches of the linked repository, including the behavior after removing the libsql-client-ts driver adapter; done means the action runs without the reported webpack identifier error while using the client.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, sqlite, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100