Skip to main content

Questions tagged [turborepo]

Turborepo is a high-performance build system for JavaScript and TypeScript codebases.

turborepo
Filter by
Sorted by
Tagged with
20 votes
8 answers
20k views

share env variable beween turborepo monorepo project

I ve setup a basic turborepo project and I want to share .env variables across the all the apps and some of packages. If I set one .env file in the root of project and how can all apps and packages ...
Adam's user avatar
  • 509
13 votes
2 answers
5k views

How to configure module aliases in a monorepo bootstrapped with Turborepo?

I am attempting to migrate several repositories to the monorepo architecture and I am currently working on a POC bootstrapped with Turborepo. The issue I am seeing is that ts module aliasing isn't ...
Logan Murphy's user avatar
12 votes
2 answers
5k views

turborepo package unexpected token export

I have a custom package named project-types where i share my types between packages and when i import the simple class into my nestjs project typescript compiles it just fine, but when it comes to ...
Ali's user avatar
  • 643
12 votes
2 answers
9k views

How to use Turborepo for an existing react app created with Create React App in order to make it a monorepo?

I have a fun project made with create react app. I want to convert the same application to a browser extension. This idea forces me to make the project a mono repo. Because in both applications, I ...
cooskun's user avatar
  • 628
11 votes
3 answers
6k views

Turborepo - library consuming another library - You may need an appropriate loader to handle this file type

Reproduction app: https://github.com/uriklar/turborepo-lib-dep-lib-repro I'm using Turborepo's basic example (nextjs app + ui library) I want to add an additional ui library and have my ui library ...
Uri Klar's user avatar
  • 3,988
10 votes
3 answers
12k views

Error: $VARIABLE is not listed as a dependency in turbo.json

I'm not able to solve an error which is mentioned in the title: Error: $VARIABLE is not listed as a dependency in turbo.json When I run npm run build I get errors for 2 variables and not for all of ...
Floky99's user avatar
  • 642
9 votes
3 answers
6k views

Turborepo Eslint config not applying

I created a Turborepo testing project and I wanted to try if ESlint config that it's set in the root of the Turborepo applies to all of the projects inside my /apps folder, turns out it does not work ...
Floky99's user avatar
  • 642
9 votes
0 answers
981 views

tRPC AppRouter is defined as "any" on import with Turborepo

I am currently using a monorepo with Turborepo to store all my microservices code in a single repository, each with a package.json and a tsconfig.json, all of them written in nodejs. in each tsconfig....
kennysliding's user avatar
  • 2,961
8 votes
1 answer
2k views

webpack not bundling packages in monorepo (turborepo) then throws "unexpected token 'export'"

EDIT: Repository where issue can be reproduced easily: https://github.com/sebastiangug/turborepo-nestjs I have a turborepo project with several nestjs applications that share various packages. I've ...
SebastianG's user avatar
  • 9,217
8 votes
1 answer
1k views

Deploying a Turborepo Next.js App to Azure Static Web App

I'm attempting to deploy a Next.js site in a Turborepo monorepo to an Azure Static Web App using GitHub actions and a custom build step. The Next.js site is configured to use a standalone output, but ...
Weston Sankey's user avatar
8 votes
1 answer
1k views

Automatically transpile TypeScript packages from other workspace in Turborepo

I have a Turborepo-based monorepo in which I have one main TypeScript application (called @myscope/tsapp) which uses another TypeScript package in the same repository (called @myscope/tspackage). You ...
sigalor's user avatar
  • 1,301
7 votes
2 answers
10k views

React.js (Vite) application returns 404 on return in monorepository

Nevermind... Mistake was related to the codebase (where I'm using monorepo and vercel.json was on the root directory. After moving vercel.js to package with react application everything was working ...
keinsell's user avatar
  • 483
7 votes
2 answers
4k views

Styling issues in monorepo with Turborepo, SvelteKit and Tailwind

I’ve created a monorepo with Turborepo that contains 2 SvelteKit apps and 2 packages: a component library (which is also based on SvelteKit) and a configuration package. root | |- packages | |- ...
Adam's user avatar
  • 211
7 votes
2 answers
7k views

How to share Vite config in monorepo?

I am trying to make monorepo using Turborepo. I have a lot of Vue projects there and I need to share Vite config across all applications. Here's how I'm trying to achieve this. I have package named @...
Andrew's user avatar
  • 1,005
7 votes
1 answer
5k views

How to pass arbitrary argument with pnpm

With npm, you can pass random arguments like this: npm run build --foo="bar" You can then access foo value this way: process.env.npm_config_foo Is it possible to do the same with pnpm?...
Dmitry's user avatar
  • 4,293
7 votes
1 answer
2k views

Turborepo set order of execution for dev pipeline

I have following scenario: /apps /api /web /packages /shared api and web have a dependency on shared. They are both installed with workspace: * using pnpm. My turbo.json looks like this: {...
JC97's user avatar
  • 1,600
7 votes
2 answers
8k views

How to use monorepo packages with nestjs using turborepo?

Here's what a real simple monorepo with nestjs using turborepo looks like: . ├── README.md ├── apps │   └── nest │   ├── README.md │   ├── nest-cli.json │   ├── package.json │   ├── ...
SugarMouse's user avatar
7 votes
0 answers
789 views

How to pass arguments to filtered workspaces separately using Turborepo?

My use case is, I have two workspaces say foo and bar, and I want to pass the different command line args, is it possible to achieve such functionality with Turborepo. I want to do something like this:...
Victordanny's user avatar
7 votes
1 answer
2k views

"Error: Invalid hook call." when importing React component from shared component library in monorepo (turborepo & npm workspaces)

I've been setting up a monorepo with the goal of creating a shared component library to use for several different Next.js apps (following this example) but whenever I import a component from the ...
jbaumann's user avatar
  • 211
6 votes
4 answers
11k views

Including local package in webpack build (turborepo)

I have two packages ui and app in a "monorepo" using turborepo. I have the ui repo with .tsx files and it's not being built, it's package.json main is a typescript file. However when running ...
ThomasReggi's user avatar
  • 58.1k
6 votes
3 answers
3k views

pnpm provides different hashes for the exact same version of the same dependency, breaking nestjs

I have a monorepo with a very basic setup available for reproducing this issue here: It is a single nestjs app with 2 packages that it reads from. @nestjs/core among other dependencies is needed for ...
SebastianG's user avatar
  • 9,217
6 votes
1 answer
4k views

Turborepo -- how to nest applications in the 'apps' folder or different top-level directory?

I'm trying to create a turborepo that contains several types of infrastructure like terraform, potentially 100+ 'serverless' functions. Ideally, I'd like to organize them a bit more into a subfolder ...
SebastianG's user avatar
  • 9,217
6 votes
0 answers
1k views

Turborepo preparing engine: Could not find "___ROOT___#build" in root turbo.json

When i run yarn build i get this error : ERROR run failed: error preparing engine: Could not find "___ROOT___#build" in root turbo.json Turbo error: error preparing engine: Could not find &...
Samyar's user avatar
  • 481
6 votes
0 answers
854 views

Can I publish only a subset of packages in one Turborepo, using Changesets?

As seen in the Turborepo docs, the monorepo can include internal packages in order to share code between apps inside the monorepo. There is also a docs section on how to publish packages in a monorepo,...
Magnus's user avatar
  • 7,461
6 votes
1 answer
4k views

Storybook - Failed to load preset: "@storybook\\react-vite\\preset"

I'm trying to use Storybook following https://turbo.build/repo/docs/handbook/tools/storybook guide (I'm using pnpm). apps/workshop/package.json { "name": "workshop", "...
CGalaxy's user avatar
  • 61
6 votes
0 answers
563 views

Create Common Shared Pages Working With Next JS and Turborepo

I have a monorepo created with turborepo which contains two next.js apps. The structures is as follows base |---apps | |---editor | | |---pages | | |---index.js //this file is ...
Vipul Rajan's user avatar
6 votes
0 answers
862 views

Can't resolve custom type definitions with a turborepo monorepo

I have a turborepo project with the following structure: apps - my-app - src - some-test.spec.ts - tsconfig.json - types - index.d.ts packages - tsconfig - base.json ...
tdranv's user avatar
  • 1,270
5 votes
3 answers
7k views

TurboRepo, run only some workspaces

this is my structure of workspaces: apps web-1 (next) web-2 (next) web-3 (next) packages pack-1 (ui) pack-2 (react utils) pack-3 (node utils) services service-1 (express) service-2 (express) ...
André Alçada Padez's user avatar
5 votes
1 answer
10k views

yarn not installing packages from workspace but instead tries pulling down from npmjs with turborepo

Version: "packageManager": "[email protected]" I have based my project off of the npx create-turbo@latest command. I have eslint-config-custom and tsconfig projects inside my /packages ...
SebastianG's user avatar
  • 9,217
5 votes
1 answer
4k views

How to setup turborepo with sveltekit and pnpm

I am trying to add Turborepo to my Svelte apps but looks like the npx create-turbo@latest command and also the examples currently only support NextJs. How can I configure it to work Svelte and ...
francis's user avatar
  • 4,377
5 votes
1 answer
2k views

VSCode - Turborepo - Automatic import suggestion for local packages misses the main entry point

We recently regrouped several repositories into a single monorepo using turborepo for better code reusability using local packages. Our folder structure looks like this: /apps | /app1 | /app2 /...
Pierre Burton's user avatar
5 votes
1 answer
634 views

How to tell what files turborepo is using to compute its hash

I am using turborepo with remote caching, and sometimes I get a cache miss that I am not expecting. Can I somehow get turborepo to list the files it is using as inputs to its hash function, so I can ...
Mike Hogan's user avatar
  • 10.4k
5 votes
1 answer
5k views

How to fix the error: "No Next.js version could be detected in your project." when deploying to Vercel with Turborepo and pnpm

I am trying to deploy the Turborepo example app to Vercel using instructions from here, and getting the error: Error: No Next.js version could be detected in your project. Make sure `"next"` ...
francis's user avatar
  • 4,377
5 votes
0 answers
2k views

Correct turborepo filter to get "affected" workspaces on push to main

Whenever a pull request is merged to main branch, i want to run turborepo run build command only on the affected workspaces. With nx.dev, i just use the ${{ github.event.before }} SHA to set as base ...
jebbie's user avatar
  • 1,447
5 votes
0 answers
2k views

Cannot find module 'postcss-preset-env' error using create-react-app inside an npm workspace

I'm trying to add a create-react-app app inside a Turborepo monorepo. Problem is that if I run npm install from the root of the monorepo and then try to start the CRA app by running npm run dev, I get ...
Camilo's user avatar
  • 7,013
4 votes
1 answer
6k views

How to create a component library on top of Tailwind with Turborepo?

I am trying to start a probject using Turborepo where many apps will use the same components. By default, Turorepo sets a packages/ui project for that, but I'd like to use Tailwind.css for this ...
Yanick Rochon's user avatar
4 votes
1 answer
6k views

turbo/no-undeclared-env-vars not recognizing changes

I'm updating my project to use turborepo and I'm encountering a strange behavior with turbo/no-undeclared-env-vars. In the starter project I added a hello constant from the environment variables: ...
Thomas's user avatar
  • 2,023
4 votes
1 answer
2k views

Choosing the Right Build System for a Multi-Tech Stack Monorepo Project

I've been investing some time in a personal project of mine, which I'm developing with a diverse tech stack that includes a React Native app, a Next.js app, a Chrome extension, and a Golang for API. I'...
kriptonian's user avatar
4 votes
1 answer
2k views

How to deploy a node app from a monorepo built with Turborepo in Azure App Services using Github Actions

I have a monorepo in Github that has been built with Turborepo. I want to deploy it in Azure App Service the backend app, but I'm having trouble finding out how to install turbo on Azure. When the ...
Jorge's user avatar
  • 146
4 votes
1 answer
3k views

How to create a shared package in a Turborepo (monorepo), for prisma generated models and types?

I am creating a monorepo using Turborepo consisting of multiple Nestjs microservices, and an API gateway to act as the request distributer. In each microservice, Postgres is used as a database and ...
Cytronic's user avatar
  • 201
4 votes
2 answers
1k views

Turborepo internal package WITHOUT Next.js

I'm trying to create an internal package in a turborepo project. The shared package follows the same setup as the example, and it works as is in the Vite frontend project. However, when importing that ...
Laci556's user avatar
  • 152
4 votes
1 answer
1k views

Adding dependencies to the "ui" package of a Turborepo with Next.js throws Unexpected token 'export'

If you run npx degit vercel/turbo/examples/with-react-native-web with-react-native-web cd with-react-native-web yarn install To create a basic Turborepo that has a Nextjs application, a react-native ...
Orleydovsky's user avatar
3 votes
3 answers
6k views

How to fix turborepo warning: failed to contact turbod

I'm getting this warning when I run my Turborepo project. My current turbo version is 1.7.0. I get this warning at every initial start of my app using yarn dev. Once the app is running I do not get ...
Simran Singh's user avatar
  • 2,553
3 votes
2 answers
4k views

How to use both root and app level env files with turborepo

I have a monorepo with the following script: "start": "env-cmd -f .env turbo run start --parallel", If I run yarn start at the root, it runs all my apps using the .env file at the ...
klugjo's user avatar
  • 20.4k
3 votes
2 answers
3k views

Module parse failed: The keyword 'interface' is reserved using turbo repo Next.js 13

I am using Next.js 13 with turbo repo.. can any one solve this problem. all components working fine with previous version on next.js... Module parse failed: The keyword 'interface' is reserved (10:0) ...
Ahsan Mirza's user avatar
3 votes
1 answer
949 views

How to use a global .env file at root with SvelteKit and Turborepo?

Is there a way to share a .env.local env variables file through my entire Turborepo app? So far it is not recognized through my SvelteKit website I've seen around that I could use dotenv-cli in the ...
flks's user avatar
  • 682
3 votes
1 answer
566 views

Keystone crashes inside Turborepo

Keystone fails to find dependencies while running yarn build inside a new Turborepo project. Steps to reproduce Install Turborepo in a new project npx create-turbo@latest navigate to the apps folder ...
remainstheday's user avatar
3 votes
1 answer
7k views

How to use TurboRepo to rebuild apps that rely on a changed package (local)

I'm currently setting up TurboRepo alongside yarn workspaces and I'm having trouble getting it to rebuild our main app whenever one of the local packages it relies on changes. Here is an example of my ...
ProgrammingPatron's user avatar
3 votes
2 answers
6k views

a turborepo pipeline task that depends on a root package.json task that does not execute in each package

I have a root package.json task that does not execute in every package that calls yarn tsc. Currently, I have it as a prebuild script in the root package.json: "prebuild": "yarn tsc&...
dagda1's user avatar
  • 28.3k
3 votes
1 answer
2k views

How to modify turborepo build command to only rebuild specific Next.js application based on latest commit?

I have a question about using turborepo with Next.js. I have two applications in my repository's apps folder, called web and docs. I am deploying them separately application on Vercel, but I am facing ...
Nightcrawler's user avatar
  • 1,061

1
2 3 4 5