Questions tagged [nrwl-nx]
Nx is an open source, next generation build system with first class monorepo support and powerful integrations.
664
questions
0
votes
0
answers
8
views
Migrate lib from old Nx workspace (without project.json) to new Nx workspace
I have a lib created in a Nx workspace that I started with very old version (can't remember which one). The lib has the following file and folder structure:
Now, in a new Nx workspace for new lib I ...
0
votes
1
answer
39
views
Problem with launching application in NX monorepo: (cannot read undefined (reading 'projects')
I had one project (grocery-shop) in NX monorepo that uses nestjs among others. The application is a strict backend api. I wanted to add a frontend and for this purpose I dragged react to the project. ...
0
votes
0
answers
17
views
How to create Nx 15 workspace with Karma/Jasmine instead of Jest/Cypress
Using create-nx-workspace --preset=angular-monorepo … (or some similar Angular preset), how can I opt for Karma/Jasmine instead of Jest/Cypress (using create-nx-workspace 15.x)? Is that possible at ...
0
votes
1
answer
42
views
CI Using Azure Pipelines and Nx fails
UPDATE: I was able to get this working by setting "ProduceReferenceAssembly" to false in the .csproj files of the libs. Not sure if this is optimal or intended but that is what worked for me....
0
votes
0
answers
21
views
How to navigate from one app to another app in Angular Nx?
I have multiple angular applications in root folder with libs. I need to navigate from one app to another. (https://i.stack.imgur.com/UokZL.png)
How should be routing for this case?
0
votes
0
answers
51
views
Nx advanced reverse proxy configuration
Migrating a react application to an Nx integrated workspace, and having an issue with advanced proxy configuration.
I understand that for a simple proxy...
Specify the proxy.conf.json file
"...
0
votes
0
answers
26
views
Export styles across packages in NX workspace
I'm using NX Monorepo where I'm trying to export SCSS variables across packages and apps. In my nx workspace I have one appliaction(nextjs) and one lib(React). My lib package is design system. I can ...
0
votes
1
answer
48
views
Cannot find module '@nrwl/webpack/package.json'
Followed the nx dev tutorial TO THE LETTER :-)
https://nx.dev/react-tutorial
When I get to the "npx nx build admin" or "npx nx serve admin" steps I get an error:
Unable to resolve @...
1
vote
1
answer
60
views
Why jest fails with "component is part of the declaration of 2 modules"?
I'm getting the following exception within executing a test in an angular (nx) project:
Error: Type FooComponent is part of the declarations of 2 modules: FooComponentModule and FooComponentModule! ...
1
vote
1
answer
25
views
List all dependencies between 2 folders/library in angular app
I have a huge angular project, and for some code refactoring, I need to list all dependencies between 2 specifics folders/libs (I'm using nx). With an example :
/apps
/lib-1
a.service.ts
...
0
votes
0
answers
18
views
Bumping inner libraries version in nx monorepo
We are currently moving some of our inner libraries into a nx monorepo.
Those libraries are publishable.
What can we use to bump our libraries versions?
0
votes
0
answers
27
views
Using Swift Code inside of a Nativescript Plugin
I'm new to Nativescript and Swift and I'm trying to use one of Nativescript's most useful feature. The Ability to use Swift/Objective C code directly inside of your Typescript code.
So in my plugin I ...
1
vote
1
answer
33
views
What is the problem of incompatibility of library versions and how monorepo-style solve it?
I started to interest in monorepo approach and Nx.js in particularly. Almost all articles talks that monorepo solve the problem of incompatibility of library versions and I don't quite understand the ...
0
votes
0
answers
30
views
How to display a file instead of downloading it with react
I use nx to build react apps and deploy it to vercel. I am able to generate .well-known folder with stellar.toml file inside it and then reference it in index.html like this:
<!DOCTYPE html>
<...
1
vote
1
answer
28
views
What misconfiguration could cause Nrwl/NX angular libraries to be affected by parent App?
There is an issue with a bit outdated Nrwl/NX project which configuration was not updated to latest.
Too many libraries are being affected via Nrwl/Angular app.
Dependency graph clearly shows double-...
0
votes
1
answer
39
views
nx command not found, nrwl installed globally
user@machine folder % npm list -g | grep nrwl
├── @nrwl/cli@14.5.4
user@machine folder % nx --version
zsh: command not found: nx
Why is my command not found? Doesn't nrwl include the nx command?
1
vote
1
answer
63
views
NX package-based repo: projectRoot vs workspaceRoot?
If I have a package-based monorepo with NX, which directory is projectRoot, and which one is workspaceRoot?
From the docs (https://nx.dev/reference/project-configuration):
{projectRoot} and {...
0
votes
0
answers
29
views
Nrwl NX enforce-module-boundaries - rule if lib does NOT have source tag?
We are trying to setup a lib in NX with a scope:example tag, such that it can only be imported by other libs with a scope:example tag.
We were hoping to set it up like this:
{
"sourceTag":...
0
votes
0
answers
14
views
(Unbound Breakpoints) How to debug nestjs project in vscode for nx project
I am trying to debug my nestjs application created by NX project in vs code. I added Launch.json file which is look like below. I have two projects in it one is angular and second one is nestjs I want ...
1
vote
1
answer
124
views
Nrwl Nx 15 + Angular 15 with SSR and PWA - Doesn't work correctly
We have project generated using Nrwl Nx monorepo tool. In one of our apps we are using Angular 15 with PWA configuration. We are going to setup server side rendering in the app. We used predefined Nx ...
0
votes
0
answers
62
views
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.
0
votes
1
answer
52
views
where to place next/font inside nx workspace
i have a NX workspace with nextjs and a few libraries. im using mui as the component library. im also using @next/font to load a google font.
I have created a library for the mui theme, i which i ...
0
votes
2
answers
119
views
Can we still create multiple apps in nx?
I worked a little bit with NX in the past. I'm trying to create 2 applications: the frontend and the admin. My recollection is that you would have a folder called /apps where all the applications ...
0
votes
1
answer
128
views
How to have Nx environment variables in React app per environment?
Context
I have a three projects inside my Nx workspace, two applications which are react apps (both of them have shared logic, however they are intended for different platforms web and microsoft teams ...
0
votes
1
answer
60
views
Nrwl/React - Upload source maps to sentry
I'm working on a React application inside my NX Workspace.
Now I want to add sentry to my project. I already have a deploy configuration in my project.json. But I'm struggling with adding the step to ...
0
votes
0
answers
63
views
Nx Daemon stops working when using custom remote cache
Whenever I build my Angular application with my custom task runner that uses a custom remote cache, the Nx daemon stops working. A commit, like you often read, does not solve the issue. I suspect that ...
1
vote
0
answers
37
views
Nx Angular - 404 after refresh with PathLocationStrategy
I am working on creating an Nx monorepo workspace for Angular apps. I have a single sandbox app and am configuring routes for it.
My configuration is as follows:
app.module.ts
@NgModule({
...
0
votes
1
answer
28
views
Is it possible conatinerise the nx library
I have a nx library which is used by many nx apps inside the monorepo. Let's say 5 apps using that library.if I made any change in the library. Currently we deploying all the 5 apps.is there an way to ...
1
vote
0
answers
48
views
NX build doesn't copy mikro-orm config to dist folder
I have NX workspace, which contains 2 angular and 1 nestjs projects. In nestjs project in future called as nestjs-server, I've implemented mikro-orm config (/apps/nestjs-server/src/app/database/mikro-...
0
votes
1
answer
56
views
NX monorepo: application uses library's source files instead of ones from dist folder
Here is the problem:
I use NX for monorepo. There is an application written in angularJS (webpack for building). It uses library that produces web components (react inside).
import { test } from "...
1
vote
0
answers
70
views
How to add font-face in storybook in nx app?
My app is built using React and NX. I am trying to add @font-face in storybook using preview-head.html file.
This is my font-face.
@font-face {
font-family: 'Switzer-Regular';
src: url('../assets/...
0
votes
0
answers
30
views
Nx-Angular: What is the difference in micro-frontend vs library and when to use which?
I’m currently in the POC phase using NX, all angular apps. One will be brand new, and the other two applications will be migrated. I'm struggling with which to use where micro-frontend vs. library. ...
0
votes
1
answer
115
views
How to import css files from react library inside libs to next.js app in nx integrated monorepo?
Can anyone help out on assets configuration in a nx next.js project.
I have multiple libs and one next.js project. I have got two problems
Some of these libs have imported .css files from ...
0
votes
1
answer
68
views
Problem importing Clarity components in Jest Unit Tests
When working with Angular in an NX workspace and writing unit tests with Jest I can not import Clarity components without braking the tests.
I am using an NX workspace with Angular preset and install @...
0
votes
0
answers
69
views
With NX/Angular, how can I debug an app production build failure?
I'm getting the following error, and I want to know how to debug it.
The command is nx run my-app:build:production
and the output includes (with a bunch of warnings omitted):
Error: Optimization error ...
0
votes
0
answers
69
views
Nx typescript error on custom build script
I would like to create a custom build script that compile multiple files from a single app but I always get compilation errors with nx. Here is a dummy project reproducing the error:
Create a new ...
0
votes
0
answers
108
views
How to share common code between libraries in nx monorepo
There are 2 libraries a (with angular) and b (with react), and a util library c which is used in both a and b. What I am expecting is when a or b is built, the code of c should be present in both the ...
2
votes
1
answer
185
views
VSCode is unable to detect the tsconfig that resides in the Next.js app created using NX
I created a new NX workspace by running:
npx create-nx-workspace@latest --preset=next --packageManager=yarn --skipGit
I have also created a shared lib by running:
npx nx g @nrwl/next:library ...
0
votes
0
answers
64
views
Is there a way to create CI/CD pipeline with Nx on Lerna Monorepo?
I have a monorepo based on Lerna and I'd like to improve the experience by integrating with Nx.
Successfully, added Nx.json and update some configuration by following the tutorial (https://nx.dev/...
3
votes
1
answer
308
views
NX: How to create a NX workspace in an existing empty git repository instead of creating it under a workspace name?
I have an existing repository. I have cleared all the unwanted files as I wanted to start a new NX-integrated project. But, I want to continue using the same repository as there are some files which I ...
0
votes
0
answers
118
views
Unable to properly deploy my NestJS API with my Angular Azure Static Web App pipeline
I'm running an NX Monorepo for two apps. One Angular App and one NestJS API. I'm trying to deploy an Azure Static Web app using a GitHub Action.
My pipeline runs smoothly with no errors (yml below). ...
0
votes
0
answers
197
views
Webpack cannot resolve dynamic imports at runtime
I am using Nx. I built an app using Webpack. Now in a dependent library, there's a dynamic import statement. Webpack gives error on runtime as Module not found with complete path of the file that is ...
1
vote
0
answers
133
views
Cypress Component Testing does not use the customWebpackConfig in NX Workspace with my angular application
I am trying to set up cypress component testing in my NX workspace with an angular application.
It does work so far, the only issue I have right now, is that it does not use my custom-webpack ...
0
votes
0
answers
44
views
How to add a remote app (micro frontend) that is not part of the NX workspace to it's Webpack config?
I created an NX workspace with a host application (based on react) that consumes 3 micro frontends (two based on React, one based on Angular) using the official documentation.
It's all working fine ...
0
votes
0
answers
138
views
How to correctly pass argument to script from command line with NX15
With the given script in package.json :
"deploy": "nx deploy --verbose --"
If we run npm run deploy my-application using NX 13.4.5 (@nrwl/nx) it produces the following output (and ...
0
votes
0
answers
65
views
Why is migration.json file not being generated after running the nx migrate latest command?
nx migrate @nrwl/angular@15.0.0
Fetching meta data about packages.
It may take a few minutes.
Fetching @nrwl/angular@15.0.0
Fetching @nrwl/angular@15.0.0
> NX The migrate command has run ...
0
votes
0
answers
34
views
How to re-use one directory between several apps inside nx monorepo?
I have an nx monorepo with a number of @nrwl/next apps.
Most of them has same files inside pages folder (routes, api routes) and have differencies only in themes.
Is there a way to re-use several ...
0
votes
0
answers
70
views
How to disable angular cache in nx repo?
I created nx project with angular preset.
How can I disable angular cache in nx?
I known there is option --skip-nx-cache, but this is a different cache (it's nx cache). I talk about .angular folder ...
0
votes
1
answer
68
views
Karma coverage does not fail the build when the coverage requirements are not met
I'm using NX from NRWL with my Angular app and I run the unit tests in my CI using the following command:
nx affected:test --base=main --watch=false --browsers=ChromeHeadlessNoSandbox --codeCoverage --...
1
vote
0
answers
68
views
Webpack cannot compile file that uses "export * as something"
I’m trying to run e2e tests for a React app using Cypress and NX.
When I run nx run dashboard-e2e:e2e (which uses cypress) I get the following webpack compilation error:
Error: Webpack Compilation ...