javascript - How to deploy monorepo powered by turborepo to Vercel? - Stack Overflow

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

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"

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"

Share Improve this question asked Dec 25, 2021 at 8:11 Mayank Kumar ChaudhariMayank Kumar Chaudhari 18.9k13 gold badges72 silver badges155 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

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 ments and updated docs)

  • you need to override the Install Command with npm install --prefix=../.. (step 3.5).

Please upvote Camilo's ment under mayank1513's post as the source (I'm just reposted for visibility and I didn't see it at first and wasted several hours)

If you're using NPM on Vercel with Turborepo please follow this step from Vercel. If you don't you'll get build errors saying roughly "can't find package".

Hope this helps!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744795271a4594168.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信