Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
322 views

How to specify dist folder as source for publishing lib to npm registry from NX monorepo?

I'm new for monorepos and especially NX. At the moment I'm trying to create a lib and publish it to npm registry. For that I use NX console to generate publishable lib and publish it to npm registry. ...
qweezz's user avatar
  • 754
3 votes
1 answer
3k views

Nx print a list of affected projects

I see that Nx is deprecating the print-affected command. The alternatives given does not produce the output I want. Right now, I am using nx print-affected --target=<script name> which tells me ...
puter's user avatar
  • 161
3 votes
0 answers
336 views

How to exclude a specific folder within an Nx monorepo library during 'nx affected:test' command

Problem: I work in an Nx monorepo with multiple apps and libraries. One of my libraries (lib-b) has an assets folder that contains non-testable resources. When I make changes inside the assets folder ...
Timur's user avatar
  • 342
3 votes
0 answers
235 views

Nx fails to work entirely -No projects have an target command for run-

I have tried using NX extention on vscode, it fails. Using commans on terminal also fails with the error -Daemon process terminated and closed the connection-. I've tried adding useDaemonProcess: ...
Mehrdokht Gohar's user avatar
2 votes
0 answers
362 views

How to change tsconfig.json inside NX Vite library/app builds

Have someone found a way to customise the tsconfig.json for NX project build. When using Vite as bundler? Here is the problem below is a standart NX(18.0.4) vite.config.ts for library. When you do 'nx ...
Hivaga's user avatar
  • 4,296
1 vote
1 answer
24 views

How to know function call came from which application in angular monorepo nx?

In monorepo nx angular application I have 2 application A & B and a common shared component C. I've inserted C in both application using components app selector. I want to know apart from URL is ...
Alok Agase's user avatar
1 vote
1 answer
41 views

What is the different between `nx target` and native command?

I am using nx to manage a monorepo and found there are many targets for nx projects e.g. @nx/eslint:lint. This target can be defined in project.json managed by nx: "targets": { "...
Joey Yi Zhao's user avatar
  • 41.1k
1 vote
1 answer
324 views

Deploying NX Monorepo with React / Express to Vercel

https://github.com/clearhost-cmd/helloapp I am struggling to deploy my NX Monorepo to Vercel. The NX Monorepo works fine on localhost - no issues. However, I cannot get it to work on Vercel. There's ...
Charlotte Wells'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
64 views

How can I get a list of projects that one project depends on via `nx`?

I am using nx to manage a mono repo which includes a few hundreds projects. I am looking for a way to find one project's dependencies. For example, I have below structure: apps/project-1 apps/project-...
Joey Yi Zhao's user avatar
  • 41.1k
1 vote
0 answers
118 views

Sharing State between MonoRepo and MicroFrontEnd

I am tring to share state between MonoRepo and MicroFrontEnd application (hosted on different domain) In the MonoRepo application, created below store and exposed visa module federation import { ...
Kikki's user avatar
  • 505
1 vote
0 answers
226 views

Vite environment variables missing when building a React App with NX

I'm currently working on a monorepo project using NX and Vite. I have multiple .env files for our multiple deployment environments: .env.dev .env.stg (staging) .env.prod (production) My problem is, ...
Olivier Papineau's user avatar
1 vote
0 answers
60 views

Multiple customers forking off same monorepo

I have 5 (soon to be more) clients. For each of them I am developing 1-2 custom apps. Each of these apps requires a react front-end, and functions backend (cloudflare workers). And the apps for a ...
Andrew's user avatar
  • 3,961
1 vote
0 answers
133 views

Compiled typescript node app throwing "Driectory import '...' is not supported resolving ES modules imported from '...'"

I'm building a full-stack web application in a monorepo managed by NX, the back-end server is a NodeJS/Express monolith written in typescript (this app was created using nx g @nx/node:application app)....
Jesse's user avatar
  • 71
1 vote
0 answers
137 views

Why doesn't `nx` rebuild if the targets were removed?

I am using nx to manage a packaged based monorepo written in typescript. I use npx nx build app command to build the code and the output folder is dist. The first time I run this command it will ...
Joey Yi Zhao's user avatar
  • 41.1k
1 vote
0 answers
169 views

I have created nx workspace with react project as host and one remote app in a microfronted-architecture

Upon running nx g @nx/next:lib my-new-lib --publishable --importPath=@happynrwl/ui-components and facing warningPublishable libraries cannot be used with bundler: 'none'. Defaulting to 'rollup'. I ...
user1999243's user avatar
1 vote
2 answers
794 views

How to generate a CSS, SASS, and vanilla JS library in an Nx Integrated monorepo?

I was wondering how to generate a CSS, SASS, and vanilla JS library in an Nx Integrated monorepo? Well, my apps are in Angular, and my 'feature' tagged libs are also Angular components. So far, so ...
Ali's user avatar
  • 1,420
1 vote
0 answers
62 views

how to detect current project using a library in nx monorepository

I have an NX mono-repository including three apps(2 react websites and 1 mobile application) and some shared libraries. How can I detect which application I am in, in one of the shared libraries codes?...
Leila Saeedy'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
1 answer
663 views

Nx 16 failed to resolve library path in react (js) integrated mono repo

Hi guys I'm new to NX Monorepo. I simply follow the instruction of how to create Integrated React Monorepo from NX official website. this link right here I exactly follow the instruction. but i have ...
Amir Rezvani's user avatar
  • 1,424
1 vote
0 answers
410 views

How to use shared assets between react and react-native in nx project

I have been using Nx with angular but now decided to migrate to reactjs and react-native. I have tried different answers to share images from the shared library to my react native app. This does not ...
Blaque_Mani's user avatar
0 votes
1 answer
106 views

error: src/main.tsx: Cannot read properties of undefined (reading 'includes') Nx monorepo ios/ android app runtime error

I am creating an nx monorepo for react and react native app. Monorepo is setup successfully and building successfully on react/ios/android. On running, it is giving error. src/main.tsx: Cannot read ...
Gypsa's user avatar
  • 11.3k
0 votes
0 answers
13 views

Is there a way to configure Nx to always run tasks from the project root rather than workspace root?

I have a mixed repo with some non-JS projects that use make for running tasks. I am integrating these into an Nx monorepo by simply defining the tasks in each project.json using the generic nx:run-...
amnesia's user avatar
  • 1,988
0 votes
0 answers
17 views

NX - Monorepo - migrating outside NX for purpose of open-sourcing non-application projects, while retaining dev experience

I've been using NX monorepo at work and for personal projects for about 2 years and I am still very happy with it. I would soon like to release a few libraries like testing tools, templating library, ...
Jarek's user avatar
  • 7,641
0 votes
0 answers
25 views

Is there a way to show nature change only via `nx show projects --affected`

I am using nx to manage a monorepo and one of the feature offered from nx is nx show projects --affected which gives me the affected apps based on the change I made in a PR. For example, if there are ...
Joey Yi Zhao's user avatar
  • 41.1k
0 votes
0 answers
88 views

nx mono repo Daemon process terminated and closed the connection

while the running the nx test it show this error "Daemon process terminated and closed the connection Please rerun the command, which will restart the daemon. If you get this error again, check ...
user25270637's user avatar
0 votes
0 answers
27 views

Nx monorepo build pulling in packages from other folders

I have a typescript monorepo using nx. I have a /frontends folder and a /services folder each with a couple of project folders, and the build all works correctly. I use TypeScript and node 20. I use ...
Kris White's user avatar
0 votes
0 answers
20 views

Reactjs monorepo or what

In my react application, after the person logs in, we redirect to different subdomains according to the user type and these different subdomains contain different content. the part where the ...
Kerem Esen's user avatar
0 votes
0 answers
21 views

Is there a way to make the Angular extract-i18n function create a single xlf file output for all projects in a monorepo?

I have a mono repo with a few applications and several libraries. Everything is Angular based Typescript. I have functioning extract-i18n tooling for each application, which pulls in library strings ...
jake's user avatar
  • 173
0 votes
0 answers
43 views

How to create custom package.json in NX preset

I am creating a new NX preset which is like a scaffold to generate new workspaces with NX. The problem is, when NX is running the npm install command, my custom package.json is still not available it ...
Jagan Pandurangan's user avatar
0 votes
0 answers
29 views

nx monorepo: Unable to resolve module ../../App org/apps/test/node_modules/expo/AppEntry.js

I have my project setup inside a monorepo. The expo version is 49.0.16 and react-native 0.72.10. The commands I execute to make the build are: cd org npm install nx run test:prebuild cd apps/test/ios ...
coder03's user avatar
  • 131
0 votes
0 answers
65 views

lerna "Assuming all packages changed" for new branches

I have a monorepo with Lerna configured version to independent. the problem is whenever create i a new git branch and run version or publish I get Assuming all packages changed and lerna wants to ...
Amit Wagner's user avatar
  • 3,234
0 votes
0 answers
37 views

Error while sharing the state from mono-repo shell app

I am trying to share state created with zustand from a mono-repo shell application to an external app outside the mono-repo which is also created using monorepo. type Store = { count: number; ...
Kikki's user avatar
  • 505
0 votes
0 answers
25 views

NX is not able to purge tailwind third-party library's classNames

I'm working on an NX project where I've organized different repositories for components, alongside incorporating a third-party Tailwind component library. Currently, I'm facing issues with duplicate ...
Hasan Mobarak's user avatar
0 votes
0 answers
132 views

how can I skip install on one package in a monorepo managed by `nx`?

I am using nx to manage a monorepo. There is one package which has a special dependency in its package.json file. This dependency requires some os level libraries pre-installed when running yarn ...
Joey Yi Zhao's user avatar
  • 41.1k
0 votes
1 answer
187 views

AWS amplify not recognizing vite react NX monorepo

I have a new NX monorepo with 3 apps. Two of them are bundled with Vite and one is a NextJS project. When I deploy the vite app to AWS Amplify it recognizes the app folder as NextJS-SSR! It also ...
Haseeb Burki's user avatar
0 votes
0 answers
166 views

How do I set up a JS monorepo with an apps and a libraries directory?

I'm pretty new to monorepos, but I had some exposure to Lerna before and I'm currently learning NX. I would like to setup a proof-of-concept project where I have several "applications" (...
Cooty's user avatar
  • 577
0 votes
0 answers
162 views

How can I create nested root project in `nx` monorepo?

I am using nx to manage a monorepo for nodejs. I have a folder structure like: apps/frontend/ui apps/frontend/design-system apps/backend/service1 apps/backend/service2 There are 4 projects under apps ...
Joey Yi Zhao's user avatar
  • 41.1k
0 votes
0 answers
156 views

How to roll back changes in NX monorepo

In my NX monorepo I have two apps: Next.js and Srapi. I tried to update Next.js' version manually by: rm -rf node_modules/ update root package.json with desired Next.js version number npm install ...
tnsaturday's user avatar
0 votes
0 answers
78 views

react native expo not importing function from NX monorepo packages

I am setting up a NX monorepo containing a package is-even and i have a front end expo react native app calling the function from this package. However, it gives me the error below. Metro has ...
hcu's user avatar
  • 21
0 votes
1 answer
306 views

module resolution error with Nx repository

Hello (and happy new year), Using a template for a monorepo provided by the company, i migrated an angular project in the monorepo. I added the needed dependencies before running npm i. After ...
Redhewlett's user avatar
0 votes
0 answers
102 views

What commands do I use and what files do I edit to configure a new nx workspace in a directory structure of existing nodejs/.NET applications?

Background: I've been following multiple nx videos and installation guides which claim to be simple with npx add-nx-to-monorepo. The guides then talk about editing workspace.json, which is deprecated, ...
Nick Triantafillou's user avatar
0 votes
1 answer
122 views

Is NX package-based monorepo do not work with Angular?

My goal is to create module federation example with package-based monorepo angular. Package-based monorepo because I am expecting this scenario: /checkout with Angular 15. /product with Angular 16. ...
Jason Rich Darmawan's user avatar
0 votes
0 answers
634 views

How can I point to repository root directory in jest config file?

I have a monorepo managed by nx. I have a jest.preset.js file in the repository root directory. There is Reporters configuration in that file as below: reporters: [ 'default', [ '<...
Joey Yi Zhao's user avatar
  • 41.1k
0 votes
0 answers
56 views

Which convention of naming features and data-access is better in Nx monorepo?

I'm starting to work with Nx in my new Angular Project and I was wondering how I should start to create new libs in my project. I can't find answers for my question, so I decided to ask you here. ...
striker's user avatar
  • 21
0 votes
0 answers
519 views

How can I only install dependencies for a particular package managed by `nx`

I have a monorepo managed by nx. And I use yarn install to install dependencies. I found when I run yarn install under one package folder, it installs dependencies from other packages. packages/is-...
Joey Yi Zhao's user avatar
  • 41.1k
0 votes
0 answers
70 views

Use RTK Query endpoints as a package in a lerna monorepo

I have Lerna Monorepo with an api folder inside of the packages folder. api folder is just RTKQuery endpoints which code split into several other folders as described in Code Splitting. I have two ...
Amir Rezvani's user avatar
  • 1,424
0 votes
0 answers
409 views

NX Monorepo not updating libraries with `nx-migrate`

I have created sample nx-monorepo for angular using v12. The original application is a polyrepo with angular cli using old version of lerna, so I am trying to upgrade it to 16 and want to go forward ...
Mitesh's user avatar
  • 75
0 votes
1 answer
465 views

How to generate Angular App shell in an integrated Nx monorepo workspace?

I think the question is self-explanatory... Is there a way to generate Angular App shell in an integrated Nx monorepo workspace? I know that if we call, let's say, nx g @nx/angular:service my-service -...
Ali's user avatar
  • 1,420
0 votes
0 answers
392 views

Module import errors in ESLint from NX

I am configuring a monorepo with Angular and other tools using NX. I have managed to run the applications correctly and now I am trying to get the Linter working. This is the configuration of the ...
Marc Fernandez's user avatar