Questions tagged [turborepo]

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

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

It optimizes builds by caching the outputs of task and running them in parallel where possible. Turborepo also supports remote caching, meaning that if someone contributing to a branch builds a package the cache is automatically shared to anyone else in working in that branch.

198 questions
17
votes
7 answers

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 access them. Or for my requirement do I need to set…
Adam
  • 437
  • 1
  • 4
  • 12
11
votes
2 answers

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 runtime and executing the javascript it…
Ali
  • 615
  • 10
  • 16
10
votes
2 answers

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 configured properly. I currently have a single ui…
Logan Murphy
  • 331
  • 2
  • 16
10
votes
2 answers

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 will use the same components, hooks, providers,…
cooskun
  • 558
  • 1
  • 5
  • 20
9
votes
2 answers

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 depend on it. // packages/ui/Button.tsx import * as…
Uri Klar
  • 3,800
  • 3
  • 37
  • 75
7
votes
0 answers

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.json, the config is identical { "extends":…
kennysliding
  • 2,783
  • 1
  • 10
  • 31
7
votes
2 answers

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 them that's what is strange to me... Error:…
Floky99
  • 562
  • 2
  • 8
  • 17
7
votes
2 answers

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 for me... Where did I mess up ? I was following…
Floky99
  • 562
  • 2
  • 8
  • 17
7
votes
1 answer

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 configured it to use webpack per the documentation…
SebastianG
  • 8,563
  • 8
  • 47
  • 111
7
votes
1 answer

"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 shared library I get Unhandled Runtime Error Error:…
7
votes
2 answers

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 perfectly. The 404 Problem I have a simple…
keinsell
  • 426
  • 5
  • 16
6
votes
1 answer

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", "private": true, "version": "0.0.0", "type": "module", "scripts": { …
CGalaxy
  • 61
  • 3
6
votes
1 answer

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: { "$schema":…
JC97
  • 1,530
  • 2
  • 23
  • 44
5
votes
0 answers

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 otherwise follows preset configurations. The…
Weston Sankey
  • 301
  • 4
  • 18
5
votes
0 answers

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 "___ROOT___#build" in root turbo.json here is my…
Samyar
  • 387
  • 3
  • 15
1
2 3
13 14