Questions tagged [nrwl-nx]

Nx is an open source, next generation build system with first class monorepo support and powerful integrations.

Nx - Smart, Fast and Extensible Build System

Nx is an open source, next generation build system with first-class monorepo support and powerful integrations. It helps you architect, test, and build at any scale, integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

Nx comes with a set of plugins for TypeScript, Angular, React, Node, Storybook, Cypress, Jest, and more, maintained by the Nx core team and a huge set of community provided extensions.

Find out more on nx.dev and on GitHub.

807 questions
10
votes
4 answers

NX - UI Library with Storybook and individually exported components

I'm exploring Nx with Angular (relatively new to both) and trying to figure out how to generate a component library that: Can run Storybook, and Can be imported one component at a time, rather than dragging the whole module/all the components into…
Sasha
  • 6,224
  • 10
  • 55
  • 102
10
votes
2 answers

Gitlab CI/CD and Nx affected:build

I'm having trouble getting Nx to build properly inside Gitlab's CI/CD tool. > nx affected:build "--prod" "--base=remotes/origin/development~1" "--head=remotes/origin/development" fatal: Not a valid object name remotes/origin/development~1…
davehyperion
  • 101
  • 1
  • 3
10
votes
4 answers

Nrwl nx command to generate lib for nest module

I am new to nrwl nx cli and extensively searched through their documentation and could not find the command to generate the nestjs module as lib rather than the actual module within app. The reason why I want to create the nestjs module as lib is…
Atul Chaudhary
  • 3,698
  • 1
  • 31
  • 51
9
votes
1 answer

Is there a way to clear NX Cloud cache?

I know I can clear nx cache with nx reset but is there a way to clear the NX Cloud cache? I could not find a command or an option in their GUI that would enable this.
Felipe Plets
  • 7,230
  • 3
  • 36
  • 60
9
votes
1 answer

Error running Jest in nx monorepo: SyntaxError: Unexpected token 'export'

Background I have a monorepo project built using Nx. This repo contains several reusable libraries for my backend projects. The packages is collected from several projects to create a reusable library. I use Jest to create and run the unit test used…
Fahmi Noor Fiqri
  • 441
  • 7
  • 15
9
votes
3 answers

How to use short paths for importing in Nx Workspace?

I have created an NX Workspace using Angular preset. Where I have one app and two libraries. Inside my app, I am trying to use shorter paths for import. With my current approach inside my app, I can use short paths for all files and folders for my…
RAHUL KUNDU
  • 745
  • 2
  • 12
  • 33
9
votes
3 answers

Angular 12 template linting not working after switchting from tslint to eslint

After upgrading an nx workspace to v12, everything works as before, expected template linted in the IDE. The IDE (WebStorm) shows some strange errors never happend before: The first warning says No directive is matched on attribute ngIf even the…
andreas.teich
  • 789
  • 1
  • 12
  • 22
9
votes
1 answer

Nrwl / Nx - how to build single js file consumable by browser with dependencies bundled

I need to build a single js that can be used as Service Worker. I have a nrwl workspace with two @nrwl/web:lib packages, one is common and the other is worker. The worker package uses common through import { stuff } from @my/common. With library…
František Žiačik
  • 7,511
  • 1
  • 34
  • 59
9
votes
2 answers

VSCode needs to be restarted after modifying tsconfig and tslint files in nrwl nx projects to eliminate errors

I'm working on a project with Nrwl nx in VSCode and whenever I change a route to a library or the prefix for a library my code shows a bunch of false errors. Everything still renders as expected but I need to reboot VSCode to make all the red lines…
Optiq
  • 2,835
  • 4
  • 33
  • 68
9
votes
4 answers

Why nrwl/nx is better that angular@6 vanilia?

Biggest advantage og nrwl/nx was implementing multiple workspaces in one project. Now angular 6 supperts it as well. What are other adventages of nx over angular@6 ?
piernik
  • 3,507
  • 3
  • 42
  • 84
8
votes
1 answer

How to build and package only the relevant dependencies using nx?

I have a project using nx that has many packages in it. My problem is that I only have a single package.json file so if I want to build only one package I still have to build the root project using npm install. This is a problem because during the…
Adam Arold
  • 29,285
  • 22
  • 112
  • 207
8
votes
2 answers

Project extension with invalid name found in Angular with NX

I am using Angular with nx and when I try to nx serve todos I get this error: Project extension with invalid name found And my project name is: todos. I followed this https://nx.dev/angular-tutorial/01-create-application to create todos app with…
Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
8
votes
3 answers

TypeError: Cannot read properties of undefined (reading 'ngModule')

Runing test I get this error TypeError: Cannot read properties of undefined (reading 'ngModule') I dont exactly know what is causing this error, but google said circular dependency issue but I am not sure where to start. Using NX-monorepo with…
arshinfor
  • 81
  • 1
  • 2
8
votes
3 answers

ReferenceError: React is not defined - Migrating from CRA to Vite and NX

I'm currently in the process of migrating a create-react-app (CRA - v4) monorepo Webpack setup to an NX Monorepo powered by vite. I'm currently stuck in trying to figure out how to solve the typical Uncaught ReferenceError: React is not…
Jose A
  • 10,053
  • 11
  • 75
  • 108
8
votes
2 answers

Nx React inject environment variables at runtime

I have a Nx monorepo with multiple react applications. I want to be able to run the build once and then deploy the same build to multiple environments (e.g. dev, test, production). What I used to do in previous projects where I wasn't using Nx, it…
marinvirdol
  • 1,263
  • 1
  • 12
  • 18
1 2
3
53 54