Next.js Discord

Discord Forum

Vercel Turborepo Deployment Errors (works locally)

Unanswered
Yellow Warbler posted this in #help-forum
Open in Discord
Yellow WarblerOP
Vercel Deployment Options
(see image)

Turborepo output:
• Packages in scope: @repo/api, @repo/db, @repo/eslint-config, @repo/lib, @repo/tailwind-config, @repo/typescript-config, @repo/ui, marketing, web
• Running build in 9 packages


Error messages:
web:build: ./app/api/trpc/[trpc]/route.ts
web:build: Module not found: Can't resolve '@repo/api'

web:build: ./app/(dashboard)/layout.tsx
web:build: Module not found: Can't resolve '@repo/db'


What I've tried:
Overriding root to and corresponding build/start commands and output dir

Building packages before running turbo build by having an extra npm script turbo run build --filter='./packages/*'

12 Replies

Yellow WarblerOP
So is the alternative just npm run build in apps/web?
@Yellow Warbler So is the alternative just `npm run build` in `apps/web`?
yes, when you using npm run-script dev to start your server you should be able to build your server like: npm run-script build to create the output folder and npm run-script start to start the server
Yellow WarblerOP
im still getting the exact same errors
the generate:dev script is for prisma
@Yellow Warbler im still getting the exact same errors
try to run it locally. Do you get a .next folder?
Barbary Lion
also try redoploying with no "build cache" it works for me
@Yellow Warbler im still getting the exact same errors
Yacare Caiman
Do you want to generate the prisma client?
@B33fb0n3 try to run it locally. Do you get a .next folder?
Yellow WarblerOP
Yes but now I have a whole new error so I'm gonna make a new thread
@Yacare Caiman Do you want to generate the prisma client?
Yellow WarblerOP
Yeah
@Yellow Warbler Yeah
Yacare Caiman
I should use this

"scripts": {
    "dev": "prisma generate && next dev --turbopack",
    "build": "prisma generate && prisma db push && next build",
    "start": "next start",
    "lint": "next lint"
  },