Attempted import error in monorepo

I've set up a monorepo with Next.js and got this error:
@chat-io/nextjs:build: Import trace for requested module:
@chat-io/nextjs:build: ../../node_modules/convex/dist/esm/react/ConvexAuthState.js
@chat-io/nextjs:build: ../../node_modules/convex/dist/esm/react/index.js
@chat-io/nextjs:build: ./src/app/layout.tsx
@chat-io/nextjs:build: ../../node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fpage&page=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=F%3A%5Cprogramming-projects%5Cchat-io%5Capps%5Cnextjs%5Csrc%5Capp&appPaths=%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!./src/app/page.tsx?__next_edge_ssr_entry__
@chat-io/nextjs:build:
@chat-io/nextjs:build: ../../node_modules/convex/dist/esm/react/ConvexAuthState.js
@chat-io/nextjs:build: Attempted import error: 'useState' is not exported from 'react' (imported as 'useState').
@chat-io/nextjs:build: Import trace for requested module:
@chat-io/nextjs:build: ../../node_modules/convex/dist/esm/react/ConvexAuthState.js
@chat-io/nextjs:build: ../../node_modules/convex/dist/esm/react/index.js
@chat-io/nextjs:build: ./src/app/layout.tsx
@chat-io/nextjs:build: ../../node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fpage&page=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=F%3A%5Cprogramming-projects%5Cchat-io%5Capps%5Cnextjs%5Csrc%5Capp&appPaths=%2Fpage&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!./src/app/page.tsx?__next_edge_ssr_entry__
@chat-io/nextjs:build:
@chat-io/nextjs:build: ../../node_modules/convex/dist/esm/react/ConvexAuthState.js
@chat-io/nextjs:build: Attempted import error: 'useState' is not exported from 'react' (imported as 'useState').
1 Reply
FleetAdmiralJakob 🗕 🗗 🗙
SOLVED: Just forgot to put the Convex Provider in a Client Component

Did you find this page helpful?