RealChaiR
RealChaiR
TTCTheo's Typesafe Cult
Created by RealChaiR on 7/19/2024 in #questions
Anyone Seeing Static Files Fail to Generate in a Monorepo?
I have a monorepo setup, and I ran the create-t3 script to generate a new web app. Dev was working fine, but whenever I try to build I get an error creating the 500 and 404 pages. If I install dependencies "locally" within the app's directory instead of at the monorepo's project root the build runs successfully. Has anyone else run into this? I have older apps in the same monorepo that are running fine that were generated with an init version of 7.23.2.
**$ next build
▲ Next.js 14.2.4
- Environments: .env

Creating an optimized production build ...
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
Generating static pages (0/4) [= ]TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/home/realchair/Projects/my-monorepo/apps/web-app/node_modules/react/cjs/react.production.min.js:24:495)**
**$ next build
▲ Next.js 14.2.4
- Environments: .env

Creating an optimized production build ...
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
Generating static pages (0/4) [= ]TypeError: Cannot read properties of null (reading 'useContext')
at exports.useContext (/home/realchair/Projects/my-monorepo/apps/web-app/node_modules/react/cjs/react.production.min.js:24:495)**
2 replies