Weird webpack error with nextjs, libsql and pnpm workspaces
Hello there! 
I have a side project that uses drizzle with turso in a pnpm workspace with the following structure:
The


The thing is, I wanted a similar setup but with nextjs instead. Webpack hates it and fails to compile with the error shown in the screenshot
Works fine when moving the db files inside the
I've uploaded a minimal repro here https://github.com/carloitaben/nextjs-pnpm-monorepo-libsql-webpack-repro
Any ideas? I'm new to monorepos and I'm really curious now
seems like a funny error. Could it be some ESM/CJS compatibility error? Or something in my tsconfig files?
Thanks in advance
I have a side project that uses drizzle with turso in a pnpm workspace with the following structure:
The
web app is a Remix app with Vite, and the db package is turso + drizzle, using a db file for local development. Everything works flawlessly and the DX is awesome. Loving Drizzle so far The thing is, I wanted a similar setup but with nextjs instead. Webpack hates it and fails to compile with the error shown in the screenshot
web app, but then I loose the monorepo structure and I kinda need it for my next project I've uploaded a minimal repro here https://github.com/carloitaben/nextjs-pnpm-monorepo-libsql-webpack-repro
Any ideas? I'm new to monorepos and I'm really curious now
Thanks in advance

GitHub
Contribute to carloitaben/nextjs-pnpm-monorepo-libsql-webpack-repro development by creating an account on GitHub.