Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
22 votes
7 answers
16k views

Global Type Declarations within a NX and NextJS monorepo

I've been looking around the web to try and find s nice solution to my problem but so far I have not. I have a NX monorepo with NextJS and I am trying to create a global types/ folder that can be used ...
lukehillonline's user avatar
20 votes
0 answers
5k views

Typescript pnpm monorepo, path aliases conflicts between local dependencies during build

I have a PNPM with TurbeRepo monorepo, used this template. In this monorepo I have a NextJS app that uses a ui-shared package (local shared code, not actually an npm package). The ui-shared is made in ...
Nikola-Milovic's user avatar
12 votes
1 answer
2k views

Import shared code in Next.js app in a monorepo

I want to leverage monorepo by reusing types, DTOs, and other isomorphic app stuff from the backend (Nest.js) services within the same mono repo. In my case the next.js app and the nest.js app (which ...
DK3Z's user avatar
  • 123
10 votes
0 answers
860 views

How do you share uncompiled typescript between React Native and Next.js in a monorepo?

I have settled a monorepo with Lerna and Yarn Workspaces with this structure: project | - packages | - ReactNativeApp | - NextJsApp | - FirebaseCloudFunctions | - Common | - ...
Xiiryo's user avatar
  • 3,207
7 votes
0 answers
2k views

how can i use absolute paths in same library in NX monorepo

I am working on Nx monorepo. We have 5 library and are using imports like this '../../components/Button' in library. but instead of this, we want to use absolute imports. For example: there are 2 ...
efdali's user avatar
  • 71
6 votes
2 answers
3k views

Can't resolve 'fs' in firebase-admin/lib' when using nextjs monorepo project with lerna

I have a Lerna MonoRepo project setup. Like root/ lerna.json packgae.json package.lock.json packages/ app1 - Create react app (with firebase sdk dependency) app2 - Next Js ...
paritosh raj's user avatar
6 votes
2 answers
3k views

How to do code sharing in NestJS through Yarn Workspaces

I'm trying to do a proof of concept for a simple monorepo application. I decided to just use Yarn Workspaces (I think Lerna maybe here is overkill) to set up my package architecture. I have a shared ...
Alfonso's user avatar
  • 1,275
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
530 views

Eslint not working in VSCode for Next.js in a monorepo setup

I have a monorepo project for a full stack application. Two services that I'm working on right now are NestJs API and Next.js ssr/frontend. My folder structure is as follows: services/ api-main/ ...
Koy's user avatar
  • 608
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
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

Next.js multi zones with i18n and shared components

I am using Next.js' multi zone feature with a blog and web app so I can develop and deploy both apps independently. It was easy to set up by following their with zones example and I have set up a blog ...
Amos's user avatar
  • 1,264
4 votes
2 answers
6k views

Debug Next.js App with VSCode in NX monorepo

I'm currently trying to debug a Next.js Application inside a NX monorepo. I have enabled the Auto Attach setting in VSCode's User Settings. When I start the Application using the serve command, I can ...
dschu's user avatar
  • 5,272
4 votes
1 answer
2k views

Environmental variables in Turbo

I am trying to use an environmental variable defined in my local .env file in one of my turbo packages, but it always comes up as undefined. I am using Turbo to manage my monorepo. The app is build in ...
Robert Salca's user avatar
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
4 votes
0 answers
1k views

Sharing font files in Turbo monorepo project

I've built a mono-repository project with Turbo. I have 2 Next.js projects in this repo. I want to share font to each Next.js project. apps |- next_project1 |- next_project2 packages |- pulbic // I ...
kyun's user avatar
  • 10.2k
3 votes
1 answer
3k views

nx build command failed with TypeError: Cannot read properties of undefined (reading 'cloud')

I am trying to run nx build it was working fine, but now it stopped working. below are the logs /vercel/path0/node_modules/@nrwl/nx-cloud/lib/nx-cloud-tasks-runner.js:20 const noCloud = nxArgs['...
Vivek Maru's user avatar
  • 8,499
3 votes
1 answer
3k views

How to use Storybook components (and Lerna) in an external project done with Next.js?

I've just created my Storybook library of components (ES6 etc). It is structured as a Lerna project (all components isolated in the packages/ folder). However, that's a private repo with no real ...
Mauro's user avatar
  • 85
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
2 answers
6k views

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 ...
Mayank Kumar Chaudhari's user avatar
3 votes
0 answers
526 views

How to setup storybook in a separate app within a mono repo? Next JS 13

I'm trying to separate out my storybook from my main web app so that I can deploy my storybook separately from my web app. But I'm running into some trouble with imports. My components live under the ...
hereToLearn's user avatar
3 votes
1 answer
834 views

yarn monorepo with multiple versioning files, fix yarn version check or reset

Given the following state of my NextJS monorepo app: monorepo with multiple private packages managed via yarn workspaces develop is default branch, testing environment and has multiple commits ahead ...
Tanase Butcaru's user avatar
3 votes
0 answers
281 views

Webpack loader problem when importing React component in yarn workspaces

I am setting up a next and expo project in a monorepo with yarn workspaces. I always get the following error when trying to run a page with a component exported from another yarn workspace package: ...
Max's user avatar
  • 877
3 votes
0 answers
469 views

NextJS - React-Native monorepo with react-native-elements

I'm trying to use react-native-elements in a react-native monorepo. It works fine in the Native App, but not in the NextJS Application. First, it compiles successfully: > with-react-native-web@ dev ...
ppressl's user avatar
  • 31
2 votes
1 answer
4k views

How to automatically restart Next.js app after an update in another library?

I have a monorepo with two apps: The web app (Next.js) The UI library (Tailwind, which uses Microbundle) The only way I managed to make the web app see the changes I make to the UI library is by: ...
Guilherme Oderdenge's user avatar
2 votes
1 answer
1k views

How to change the public directory of a next js application

I have a monorepo with the following architecture: apps/ web/ - next.config.js - pages/ public/ My next js application is in the apps/web/ folder. How do I change the next.config.js file so ...
Jimmy's user avatar
  • 3,570
2 votes
3 answers
549 views

Getting Error : NX Failed to create directory: /app/node_modules/.cache/nx while creating Docker Image

I was trying to dockerize the monorepo with NX, NEXTJS and "NESTJS app, Tried the below Dockerfile.frontend - # Install deps and build the source code only when needed FROM node:lts-alpine AS ...
CandleCoder's user avatar
  • 1,467
2 votes
1 answer
3k views

Monorepo with Lerna & Next.JS not working : Module not found

Not sure what I am doing wrong. I am trying to setup a monorepo with lerna & nextjs and have been following a tutorial but get stuck at this point. My file structure looks exactly as specified in ...
antonwilhelm's user avatar
  • 7,028
2 votes
2 answers
1k views

"Single source of truth" schema/validation class for server (NestJs/GraphQL/TypeGraphQL/Prisma) and client (NextJs)

I'm building an Typescript application using an NX monorepo, NestJs/GraphQL/TypeGraphQL (built into @nestjs/graphql)/Prisma/PostgreSQL on the server, and NextJs on the client. With this stack (when ...
Will Despard's user avatar
2 votes
1 answer
324 views

Turborepo says npm not installed

? Which package manager do you want to use? npm (not installed) pnpm yarn (not installed) ? Which package manager do you want to use? npm pnpm yarn (not installed)
Ayush Papnai's user avatar
2 votes
1 answer
823 views

Monorepo: (NextJS 13 + Typescript) Module parse failed

I'm trying to move a currently working nextjs 13 app to a single monorepo. I basically created a new repo using npx create-turbo@latest and then moved my existing repo (lest call it "frontend&...
Marco's user avatar
  • 1,162
2 votes
2 answers
2k views

Nextjs + Expo in Monorepo "Invalid Hooks Call"

I've created a monorepo with 4 packages like so: . ├── lerna.json ├── package.json ├── packages │   ├── admin-> Basic CRUD for backend with Nextjs │   ├── mobile-> Expo app │   ├── server-> ...
Jeremy's user avatar
  • 1,605
2 votes
0 answers
394 views

Module not found: Can't resolve '@your-org/core-lib' in nextjs?

I am new in monorepo or yarn workspace .So learning I follow this starter boilerplate https://github.com/belgattitude/nextjs-monorepo-example I forked the above example .And run yarn command on root ...
user5711656's user avatar
  • 3,614
2 votes
0 answers
2k views

Next.js monorepo: multiple apps on subdomains vs. one app?

I just started using nx.dev to migrate from a single app repo to a monorepo as I have added a very basic static documentation app to the mix which is deployed to a subdomain docs.company.com. My main ...
Peterhack's user avatar
  • 1,051
1 vote
1 answer
1k views

How to use JavaScript instead of typescript in nx monorepo setup for NextJS?

I want to create NextJS monorepo using nx using javascript. I don't want to use TypeScript for my project. But I didn't found any solution or documentation or any blog in web. My question is: Can I ...
Kheersagar patel's user avatar
1 vote
1 answer
1k views

Module parse failed using Next.js in a turborepo setup

I am using a monorepo using Turborepo: apps |__ api |__ cms packages |__ validation-schemas The validation-schemas packages is where I am implement all the zod validation schemas to be used in the ...
Florian Ldt's user avatar
  • 1,063
1 vote
1 answer
1k views

Custom webpack config with next.js and next-fonts in a monorepo with @expo/vector-icons

I am trying to use solito to use a monorepo with React Native and Next.js. I successfully created a brand new project. My next step is to add a UI library called react-native-paper. Looks good so far ...
David Leuliette's user avatar
1 vote
1 answer
2k views

How do I configure a Nextjs project to transpile a monorepo project with next bundle analyzer?

I want to configure next js bundle analyzer with transpiling monorepo. I have a error message for loader. so I did this Stack overflow But It still has error. How do I configure a Nextjs project to ...
september21st's user avatar
1 vote
0 answers
207 views

i want to create one docker file for next.js monorepo

this is my project structure in monorepo and i have dist folder after build project-3. i created docker file for project-3 , but it is too large so what is solution for decrease size of docker file in ...
Parth Solanki's user avatar
1 vote
0 answers
86 views

Design system with tailwind

I developed a design system using tailwind and storybook (https://github.com/RicardoBrito1938/monorepo-design-system) After i published on NPM, to consume this design system in other react/next js app ...
Ricardo Teixeira's user avatar
1 vote
1 answer
1k views

Expo + NextJS "fs module not found" build error

Using a Solito (https://solito.dev/), I've built a monorepo for NextJS + Expo React Native cross-platform application where I've successfully deployed both web and iOS apps. But, I accidentally wiped ...
mfang's user avatar
  • 13
1 vote
0 answers
163 views

How to access directory or file outside of root directory in React Native

I am working on project that involves creating a mobile app and website, so I decide to create same or shared screen (pages) for both my app and website. So I decided to go with this file structure. ...
Ashish Devashi's user avatar
1 vote
0 answers
28 views

Monorepo referring to NextJs module

Packages in a TypeScript monorepo... web (NextJs) server (Node) lib (plain library) From server I can refer to lib with... import { something } from "@acme/lib/dist/somemodule" That works....
user358041's user avatar
1 vote
1 answer
692 views

Auto import for shared libs not working in NX

Created an NX monorepo with a shared library in nextjs, typescript ("@nx/next": "16.5.1",). Components that are located in the shared library can be imported in the main app by ...
Rowin_nb2's user avatar
  • 322
1 vote
0 answers
214 views

Monorepo shared common function for firebase

I have init a monorepo which has the following structure. Some of the functions from firebase need to be shared. Therefore I decide to put them in the package/utils repo. I need to pass down the ...
tcf01's user avatar
  • 1,749
1 vote
1 answer
386 views

NX monorepo Next.js "Invalid hook call" when using jotai

I'm getting an out-of-place "Invalid hook call" error inside of a Next.js app in an NX workspace. I have put together this CodeSandbox. The start command fails when run automatically, so you ...
chocojunkie's user avatar
1 vote
0 answers
127 views

Gitlab CI monorepo with submodules

I have such project structure: / /apps/ frontend_1 [git submodule] frontend_2 [git submodule] /modules/ ui-components [git submodule] How can i implement ...
Roman's user avatar
  • 11
1 vote
1 answer
2k views

Design structure for nextjs and nestjs inside nx monorepo with pnpm

I am planning to nextjs app on frontend and nestjs for backend inside NX monorepo using pnpm workspace. I am confused how should I design the complete folder structure. Should I use package based ...
kittu's user avatar
  • 6,949
1 vote
0 answers
3k views

Why my Dockerfile for NextJS app very slow when building image and has huge size

I've NX monorepo with a NextJS web-app. It's s very simple, just one page with "hello world", with no assets and images. I've made a Dockerfile for my webapp, below is my Dockerfile, and ...
Sergo's user avatar
  • 71
1 vote
0 answers
176 views

Webpack Not Resolving Tsconfig Paths in Subproject

I have a project which is a monorepo, using NPM workspaces and TS project references to separate the components. The frontend workspace is a Next.js app, and it imports some types and utilities from ...
LemongrabThree's user avatar