Hello all,
We’ve been working on upgrading our monorepo project, which uses Turborepo, Next.js, and React, to the latest versions. We’ve followed each upgrade guide carefully and migrated everything accordingly.
Both next build and development (next dev) are working perfectly when run locally in each of our monorepos. However, the problem arises when we try to build the project on Vercel.
Here’s what we’ve tried so far to resolve the issue:
- Moved react, react-dom, and their respective types from the child
package.json
files to the rootpackage.json
. - Added
CI=false
to the environment variables. - Fixed types and resolved any potential issues that could break the build (as mentioned, the build works fine locally).
- Cleared the
package-lock.json
,package.json
, andnode_modules
over 20 times, followed by fresh installations. - Investigated potential issues related to Prisma, as it was one of our initial suspects.
- Tried numerous other fixes.
Despite all these efforts, nothing has resolved the issue. We keep encountering the same error on Vercel without any detailed logs, even after trying to enable more verbose logging.
It’s worth noting that the other repositories in our monorepo build successfully—this issue is limited to the largest one.
Any suggestions or insights would be greatly appreciated!
node: 20.x
react: 19.0.0
next: 15.1.6
turbo: 2.3.3
Last build logs:
[15:18:34.464] Running build in Washington, D.C., USA (East) – iad1
[15:18:34.571] Cloning github.com/koslib/schedulthreads (Branch: staging, Commit: a3cf288)
[15:18:34.584] VERCEL_FORCE_NO_BUILD_CACHE is set so skipping build cache step
[15:18:35.449] Cloning completed: 878.000ms
[15:18:35.449] Running "npx turbo-ignore"
[15:18:35.699] npm warn config ignoring workspace config at /vercel/path0/apps/web/.npmrc
[15:18:35.699]
[15:18:36.384] npm warn exec The following package was not found and will be installed: turbo-ignore@2.3.4
[15:18:36.384]
[15:18:36.733] ≫ Using Turborepo to determine if this project is affected by the commit...
[15:18:36.733]
[15:18:36.733]
[15:18:36.736] ≫ Inferred "web" as workspace from "package.json"
[15:18:36.737]
[15:18:36.737] ≫ Inferred turbo version "^2.3.3" from "package.json"
[15:18:36.737] ≫ Using "build" as the task from the arguments
[15:18:36.737]
[15:18:36.742] ≫ Previous deployment ("9b7d4b559d01b3582aa63e7db93bb30416765e94") for "web" on branch "staging" is unreachable.
[15:18:36.743]
[15:18:36.743] ✓ Proceeding with deployment
[15:18:36.743]
[15:18:37.210] Running "vercel build"
[15:18:37.655] Vercel CLI 39.3.0
[15:18:37.777] > Detected Turbo. Adjusting default settings...
[15:18:37.993] Running "install" command: `npm install --legacy-peer-deps`...
[15:18:38.150] npm warn config ignoring workspace config at /vercel/path0/apps/web/.npmrc
[15:19:11.996]
[15:19:11.996] added 1038 packages, and audited 1046 packages in 34s
[15:19:11.997]
[15:19:11.997] 190 packages are looking for funding
[15:19:11.997] run `npm fund` for details
[15:19:11.998]
[15:19:11.998] found 0 vulnerabilities
[15:19:12.034] Detected Next.js version: 15.1.6
[15:19:12.035] Running "turbo run build"
[15:19:15.339]
[15:19:15.340] Attention:
[15:19:15.340] Turborepo now collects completely anonymous telemetry regarding usage.
[15:19:15.340] This information is used to shape the Turborepo roadmap and prioritize features.
[15:19:15.340] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[15:19:15.340] https://turbo.build/repo/docs/telemetry
[15:19:15.340]
[15:19:15.482] • Packages in scope: web
[15:19:15.482] • Running build in 1 packages
[15:19:15.483] • Remote caching enabled
[15:19:15.539] @repo/db:db:generate: cache bypass, force executing 24012eaf1190bcc2
[15:19:15.769] @repo/db:db:generate:
[15:19:15.770] @repo/db:db:generate: > @repo/db@0.0.0 db:generate
[15:19:15.771] @repo/db:db:generate: > prisma generate
[15:19:15.771] @repo/db:db:generate:
[15:19:18.655] @repo/db:db:generate: Prisma schema loaded from prisma/schema.prisma
[15:19:19.973] @repo/db:db:generate:
[15:19:19.973] @repo/db:db:generate: ✔ Generated Prisma Client (v5.22.0) to ./../../node_modules/@prisma/client in 209ms
[15:19:19.973] @repo/db:db:generate:
[15:19:19.973] @repo/db:db:generate: Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
[15:19:19.973] @repo/db:db:generate:
[15:19:19.973] @repo/db:db:generate: Help us improve the Prisma ORM for everyone. Share your feedback in a short 2-min survey: https://pris.ly/orm/survey/release-5-22
[15:19:19.974] @repo/db:db:generate:
[15:19:20.314] web:build: cache miss, executing 9b3fcedc8f8c0937
[15:19:20.471] web:build: npm warn config ignoring workspace config at /vercel/path0/apps/web/.npmrc
[15:19:20.493] web:build:
[15:19:20.493] web:build: > web@0.1.0 build
[15:19:20.493] web:build: > next build
[15:19:20.493] web:build:
[15:19:22.055] web:build: Attention: Next.js now collects completely anonymous telemetry regarding usage.
[15:19:22.055] web:build: This information is used to shape Next.js' roadmap and prioritize features.
[15:19:22.056] web:build: You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[15:19:22.056] web:build: https://nextjs.org/telemetry
[15:19:22.056] web:build:
[15:19:22.119] web:build: ▲ Next.js 15.1.6
[15:19:22.119] web:build: - Experiments (use with caution):
[15:19:22.119] web:build: · turbo
[15:19:22.119] web:build: · clientTraceMetadata
[15:19:22.119] web:build:
[15:19:22.210] web:build: Creating an optimized production build ...
[15:19:22.490] web:build: [@sentry/nextjs] The Sentry SDK has enabled source map generation for your Next.js app. If you don't want to serve Source Maps to your users, either set the `sourcemaps.deleteSourcemapsAfterUpload` option to true, or manually delete the source maps after the build. In future Sentry SDK versions `sourcemaps.deleteSourcemapsAfterUpload` will default to `true`. If you do not want to generate and upload sourcemaps, set the `sourcemaps.disable` option in `withSentryConfig()`.
[15:19:22.543] web:build: [@sentry/nextjs - Node.js] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[15:19:22.543] web:build: [@sentry/nextjs - Node.js] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[15:19:22.624] web:build: [@sentry/nextjs - Node.js] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[15:20:33.314] web:build: [@sentry/nextjs - Edge] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[15:20:33.315] web:build: [@sentry/nextjs - Edge] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[15:20:33.349] web:build: [@sentry/nextjs - Edge] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[15:20:39.176] web:build: <w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (318kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
[15:20:39.770] web:build: [@sentry/nextjs - Client] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[15:20:39.770] web:build: [@sentry/nextjs - Client] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[15:20:39.908] web:build: [@sentry/nextjs - Client] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[15:21:08.166] web:build: ⚠ Compiled with warnings
[15:21:08.167] web:build:
[15:21:08.167] web:build: ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js
[15:21:08.167] web:build: Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
[15:21:08.167] web:build:
[15:21:08.167] web:build: Import trace for requested module:
[15:21:08.167] web:build: ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js
[15:21:08.167] web:build: ../../node_modules/libheif-js/wasm-bundle.js
[15:21:08.167] web:build: ../../node_modules/heic-decode/index.js
[15:21:08.167] web:build: ../../node_modules/heic-convert/index.js
[15:21:08.167] web:build: ./app/components/MediaUpload.tsx
[15:21:08.167] web:build: ./app/components/PostPage.tsx
[15:21:08.167] web:build: ./app/post/[id]/page.tsx
[15:21:08.167] web:build:
[15:21:08.167] web:build: ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js
[15:21:08.167] web:build: Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
[15:21:08.167] web:build:
[15:21:08.167] web:build: Import trace for requested module:
[15:21:08.167] web:build: ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js
[15:21:08.167] web:build: ../../node_modules/libheif-js/wasm-bundle.js
[15:21:08.168] web:build: ../../node_modules/heic-decode/index.js
[15:21:08.168] web:build: ../../node_modules/heic-convert/index.js
[15:21:08.168] web:build: ./app/components/MediaUpload.tsx
[15:21:08.168] web:build: ./app/components/PostPage.tsx
[15:21:08.168] web:build: ./app/schedule/page.tsx
[15:21:08.168] web:build:
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.168] web:build: A Node.js API is used (process.cwd at line: 24) which is not supported in the Edge Runtime.
[15:21:08.168] web:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
[15:21:08.168] web:build:
[15:21:08.168] web:build: Import trace for requested module:
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/createGetAuth.js
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/index.js
[15:21:08.168] web:build:
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.168] web:build: A Node.js API is used (process.cwd at line: 39) which is not supported in the Edge Runtime.
[15:21:08.168] web:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
[15:21:08.168] web:build:
[15:21:08.168] web:build: Import trace for requested module:
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/createGetAuth.js
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/index.js
[15:21:08.168] web:build:
[15:21:08.168] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.168] web:build: A Node.js API is used (process.cwd at line: 135) which is not supported in the Edge Runtime.
[15:21:08.169] web:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
[15:21:08.169] web:build:
[15:21:08.169] web:build: Import trace for requested module:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/createGetAuth.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/index.js
[15:21:08.169] web:build:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: A Node.js API is used (process.cwd at line: 142) which is not supported in the Edge Runtime.
[15:21:08.169] web:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
[15:21:08.169] web:build:
[15:21:08.169] web:build: Import trace for requested module:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/createGetAuth.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/index.js
[15:21:08.169] web:build:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: A Node.js API is used (process.cwd at line: 143) which is not supported in the Edge Runtime.
[15:21:08.169] web:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
[15:21:08.169] web:build:
[15:21:08.169] web:build: Import trace for requested module:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/createGetAuth.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/index.js
[15:21:08.169] web:build:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: A Node.js API is used (process.cwd at line: 148) which is not supported in the Edge Runtime.
[15:21:08.169] web:build: Learn more: https://nextjs.org/docs/api-reference/edge-runtime
[15:21:08.169] web:build:
[15:21:08.169] web:build: Import trace for requested module:
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/keyless-node.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/createGetAuth.js
[15:21:08.169] web:build: ../../node_modules/@clerk/nextjs/dist/esm/server/index.js
[15:21:08.169] web:build:
[15:21:08.174] web:build: Skipping validation of types
[15:21:08.174] web:build: Skipping linting
[15:21:08.774] web:build: npm error Lifecycle script `build` failed with error:
[15:21:08.774] web:build: npm error code 1
[15:21:08.775] web:build: npm error path /vercel/path0/apps/web
[15:21:08.775] web:build: npm error workspace web@0.1.0
[15:21:08.775] web:build: npm error location /vercel/path0/apps/web
[15:21:08.775] web:build: npm error command failed
[15:21:08.775] web:build: npm error command sh -c next build
[15:21:08.780] web:build: ERROR: command finished with error: command (/vercel/path0/apps/web) /node20/bin/npm run build exited (1)
[15:21:08.780] web#build: command (/vercel/path0/apps/web) /node20/bin/npm run build exited (1)
[15:21:08.782]
[15:21:08.782] Tasks: 1 successful, 2 total
[15:21:08.782] Cached: 0 cached, 2 total
[15:21:08.782] Time: 1m53.435s
[15:21:08.782] Summary: /vercel/path0/.turbo/runs/2sG8IC8cLtU7Aas4qVy7C4r2oBI.json
[15:21:08.782] Failed: web#build
[15:21:08.782]
[15:21:08.794] ERROR run failed: command exited (1)
[15:21:08.821] Error: Command "turbo run build" exited with 1
[15:21:09.446]
package.json
{
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@atproto/api": "^0.13.31",
"@atproto/oauth-client-node": "^0.2.8",
"@aws-sdk/client-s3": "^3.735.0",
"@aws-sdk/s3-request-presigner": "^3.735.0",
"@clerk/nextjs": "^6.10.2",
"@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/list": "^6.1.15",
"@fullcalendar/react": "^6.1.15",
"@fullcalendar/timegrid": "^6.1.15",
"@giphy/js-fetch-api": "^5.6.0",
"@giphy/react-components": "^9.8.0",
"@headlessui/react": "^2.2.0",
"@hookform/resolvers": "^3.10.0",
"@lemonsqueezy/lemonsqueezy.js": "^4.0.0",
"@next/third-parties": "15.1.6",
"@popperjs/core": "^2.11.8",
"@prisma/client": "^5.20.0",
"@radix-ui/react-alert-dialog": "^1.1.5",
"@radix-ui/react-dropdown-menu": "^2.1.5",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-select": "^2.1.5",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-toast": "^1.2.5",
"@radix-ui/react-tooltip": "^1.1.7",
"@radix-ui/react-visually-hidden": "^1.1.1",
"@repo/db": "*",
"@repo/smart-scheduling": "*",
"@repo/tasks": "*",
"@repo/ui": "*",
"@sentry/nextjs": "^8.51.0",
"@stripe/stripe-js": "^5.5.0",
"@tanstack/react-table": "^8.20.6",
"@trigger.dev/sdk": "^3.3.12",
"@types/react-calendar-heatmap": "^1.9.0",
"axios": "^1.7.9",
"cookie": "^1.0.2",
"date-fns": "^4.1.0",
"date-fns-tz": "^3.2.0",
"eslint-config-next": "^15.1.6",
"framer-motion": "^12.0.5",
"heic-convert": "^2.1.0",
"iron-session": "^8.0.4",
"js-cookie": "^3.0.5",
"loops": "^4.0.0",
"lucide-react": "^0.474.0",
"next": "^15.1.6",
"next-intl": "^3.26.3",
"postcss-nesting": "^13.0.1",
"posthog-js": "^1.210.1",
"posthog-node": "^4.4.1",
"react-confetti": "^6.2.2",
"react-hook-form": "^7.54.2",
"react-popper": "^2.3.0",
"react-toastify": "^11.0.3",
"recharts": "^2.15.0",
"sharp": "^0.33.5",
"stripe": "^17.5.0",
"styled-components": "^6.1.14",
"svix": "^1.45.1",
"tailwind-merge": "^2.6.0",
"textarea-caret": "^3.1.0",
"uuid": "^11.0.5",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@trigger.dev/build": "^3.3.12",
"@types/cookie": "^1.0.0",
"@types/heic-convert": "^2.1.0",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20",
"@types/textarea-caret": "^3.0.3",
"@types/uuid": "^10.0.0",
"class-variance-authority": "^0.7.1",
"eslint": "^9",
"postcss-import": "^16.1.0",
"prisma": "^5.20.0",
"typescript": "^5",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0"
}
}