Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy monorepo powered by turborepo to Vercel?

Recently, Turborepo is acquired by Vercel. So I was excited to experiment with that. I created a turbo repo project by running

pnpx create-turbo

Then I tried to deploy it to Vercel following the documentation here.

It is failing with error "could not found tsconfig/nextjs.json"

like image 408
mayank1513 Avatar asked Oct 31 '25 22:10

mayank1513


1 Answers

The error was actually caused at tsconfig.json file inside the web module.

The structure of the repo is as follows

- apps
  - docs
  - web
- packages
  - config
  - tsconfig
  - ui

The content of apps/web/tsconfig.json is

{
  "extends": "tsconfig/nextjs.json",
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Ideally, it should have been able to work as turbo should understand that.

I could finally deploy the web project with following settings on Vercel

ROOT DIRECTORY: /app/web
BUILD COMMAND: cd ../.. && yarn build
INSTALL COMMAND: cd ../.. && yarn install

Update: (Answer from comments and updated docs)

  • you need to override the Install Command with npm install --prefix=../.. (step 3.5).
like image 174
mayank1513 Avatar answered Nov 03 '25 12:11

mayank1513