Questions tagged [nrwl-nx]
Nx is an open source, next generation build system with first class monorepo support and powerful integrations.
810
questions
0
votes
0
answers
4
views
How to include source links in Webpack-bundled code when using Nx in development mode
I have an Nx project that has an express application. When I'm running the application in dev mode:
nx serve my-app
and an error occurs I get a stack trace that links to the webpack bundle, and not ...
0
votes
0
answers
19
views
Generate package.json per Angular project with Nx builder
Good morning, I have a Nx project with an Angular app and a NestJS backend for frontend app with some libs for each project.
I’m using the @angular-devkit/build-angular:browser build executor for the ...
2
votes
1
answer
16
views
How run custom command ( run bash script ) before NX command?
I would like to execute a .sh script before running the "serve" command. Is there an option in Nx similar to "before"?
So, I want to run a bash script when I execute npx nx run ...
0
votes
0
answers
7
views
ProxyZone Problems with Harnesses after Angular/Material Update from 15 to 16 using nrwl/nx
I updated from Agnular 15 to Angulat 16.
Now a lot of my Unit Tests fail, claiming:
Expected to be running in 'ProxyZone', but it was not found.
I found Issues stating that i shouldn't mix fakeAsync ...
0
votes
0
answers
10
views
How to use nx affected for multiple targets with different args for each?
In our project we use an nx monorepos for multiples angular apps.
I tried this command :
nx affected -t lint build test --base=origin/master --head=HEAD --parallel=3 --runInBand --logHeapUsage --...
0
votes
0
answers
27
views
nx doesn't show question on input prompt via readline
I'm running a CLI inside an nx monorepo via nx run and it seems like nx is buffering CLI output on newlines and preventing interactively answering prompts from the terminal. Here's a simple example:
...
1
vote
0
answers
79
views
How to properly deploy an Angular i18n app on Azure Static Web Application?
I have things mostly working, but this staticwebapp.config.json is causing me more trouble than a typical nginx or apache configuration.
This is an Angular 15 Application with i18n configured.
My ...
0
votes
0
answers
7
views
NX Console plugin only showing NX Cloud UI
I have installed the nx console after creating a new workspace using nx create-nx-workspace@latest and selecting the angular options. When I click into nx console extension, there is no option for ...
1
vote
1
answer
53
views
Adding WorkBox to an angular app in an NX workspace
I'm trying to switch ServiceWorker in my application, from @angular/service-worker to workbox, but I'm finding documentation lacking good examples. I know this is a framework agnostic tool, but the ...
0
votes
0
answers
17
views
Error: Unable to resolve @nrwl/web:dev-server
how do i fix this error when i try to run my script to start my app i get the error Cannot find executor 'dev-server' with the path to the executor.json
I tried running yarn dev:ess but i get the ...
0
votes
0
answers
14
views
Does “fileReplacements” option works with react native using nx
I have to load different environment files based on different commands, so I did this in nx project.json of react native mobile project
"build-android": {
"executor": "@...
0
votes
1
answer
27
views
Import main entry from secondary entry
I'm currently migrating a standard Angular library to an nx workspace.
To split the library I'm creating secondary entries. I have:
@my-corp/@my-lib
@my-corp/@my-lib/some-entry
@my-corp/@my-lib/some-...
1
vote
0
answers
20
views
Can we use dependency injection with NX?
From what I've seen in the docs and a little bit of playing with NX, I've had this question:
If you want to write your code base mostly using dependency injection, wouldn't you lose all the benefits ...
4
votes
1
answer
77
views
How to calculate files array in nx dep-graph?
I'm using NX v16.1.4. In these version with every build the file node_modules/.cache/nx/nxdeps.json is created.
The structure of this file is not identical to the file, which can be generated by nx ...
1
vote
2
answers
61
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 ...
0
votes
1
answer
31
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 -...
0
votes
0
answers
22
views
Angular i18n for a non-buildable Nx lib - is it possible?
I have an Nx monorepo with many Angular libraries and 1 Angular app.
I want to implement i18n, without any additional libraries, only using the built-in Angular i18n as described in their docs.
Given ...
2
votes
0
answers
152
views
Nx no longer supports the v2 format of angular.json
I am trying to upgrade angular (v15) and nx (v16) in my project, but the issue that I am running into is when I start my project NX throws an error:
> NX angular.json format is incorrect
Nx ...
0
votes
0
answers
44
views
Nx monorepo with react host and mixed angular and react microfontends (MFE) using module federation
We have an Nx mono repo with a react host app. Not all teams work in this repository, especially some using angular. I've seen StackOverflow Q/A and other articles on importing angular micro-frontends ...
1
vote
1
answer
50
views
After doing a migration to nx's latest (16.7.4) projects stopped being detected
After trying to migrate nx to the latest version via:
nx migrate latest
and running the migrations and yarn my projects in the monorepo stopped being detected by int:
nx show projects
Simply outputs ...
0
votes
0
answers
8
views
NX workspace with Module Federation vs. axios-retry: No version specified and unable to automatically determine one
I have an NX workspace (latest version) in which I have implemented a React app. The workspace uses Webpacks Module Federation, since the React app is later to be exposed as a micro frontend.
I am ...
0
votes
0
answers
33
views
NX Unable to resolve @nrwl/node:execute
Cannot find executor 'execute' in C:\Users\ssss\Desktop\code-base\node_modules@nrwl\node\executors.json.
Pass --verbose to see the stacktrace..
I upgraded to node v16.20.0 and upgraded nrwl/cli to 15....
0
votes
0
answers
23
views
nx generate @nx/react:lib , webpack option not available
I'm new to NX and Webpack. Trying to generate a library with nx g @nx/react:lib.
I notice that the bundler option is only none/vite/rollup.
Do I need to install webpack on the library ? If not, does ...
0
votes
1
answer
18
views
how to publish react component library to an npm pacakge without aa.TextEncoder error when using the npm package
i've been publishing react component library npm packages (that contain only client side components).
https://github.com/comcast/porrtal
https://www.npmjs.com/search?q=%40porrtal
recently, i published ...
2
votes
1
answer
74
views
Shell tries to load remote module from wrong port ("cannot match any routes")
I have the following issue, briefly described in the below image:
The shell appolication has 2 mfe's as follows (module-federation.config.js):
const ModuleFederationPlugin = require('webpack/lib/...
0
votes
0
answers
73
views
[Github Actions]: "EACCES: permission denied, open " for `vite.config` in hosted image run
I have a build using vite.
When I'm running build locally and on regular self hosted runners, the build works.
When the build is running on a hosted image based runner, the build fails because it ...
0
votes
0
answers
28
views
Compiling SASS dependencies in a publishable Nx/Nrwl library... NPM vs PNPM
Given a single script run in both NPM and PNPM, the NPM version will succeed whereas the PNPM one fails.
npx sass --style=compressed --load-path=node_modules ./lib/path/to/style.scss ./lib/prebuilt-...
0
votes
0
answers
28
views
pnpm update vs nx migrate are giving different results
I want to use nx's migrate feature to maintain & update the package.json dependencies.
I use pnpm as my node package manager.
When running pnpm update, pnpm lists us all the outdated packages and ...
0
votes
0
answers
84
views
error: Sharp is required to be installed in standalone mode for image optimization
Dockerfile:
# Build Image - Stage 1
FROM node:20-alpine AS base
# Stage 2 - Install Dependencies
# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-...
1
vote
1
answer
78
views
NX Console : Nx Generate on VSCode on WSL throws an error
I have a NX project where I wanted to use the generate script for the nx console.
When clicking on generate I get the following error :
* Executing task: npx nx generate @nx/angular:component --name=...
2
votes
0
answers
21
views
How do you update some variable in a bundle using webpack and Angular
We have declared a variable in a file that should be replaced by an object during compilation.
declare const I18N_MAP: Record<string, string>;
While bundling the files using webpack we hash ...
0
votes
0
answers
22
views
Tree is undefined: Angular update schematics in a NX workspace
I created an Angular update schematic to update outdated variables to newer ones. However, when I ran the nx migrate and nx migrate --run-migrations commands in the NX workspace, I received a message ...
0
votes
0
answers
18
views
How Can we have Multi Versioned Angular Libraries in NX Monorepo
We are using NX as our monorepo tool, Our repo contains 4 different angular apps.
Directory Structure:-
.
└── apps/
├── app-1/
│ └── header-component
├── app-2/
│ └── header-...
0
votes
0
answers
70
views
NX: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead
Working a NX project and while there are no problems in VSCode's Problems tab while doing React work, when I goto open any *.spec.tsx file I get slammed with many of the same errors:
'React' refers to ...
1
vote
0
answers
9
views
NxNrwl shared custom form builder Library in Angular - Form Group and Nested FormGroups
I wan to create a shared NxNrwl Angular Library. That will have all the FormGroups.
Customer Form
export abstract class CustomerForm {
protected readonly _fb: FormBuilder;
constructor() {
this....
0
votes
1
answer
41
views
Nx command modifying project.json in every component when generating libary
I'm working with an Nx monorepo, and I'm using Nx to generate an angular library with the command npx nx g @nrwl/angular:library testapp --directory=myDirectory/directory. When I run this command, ...
1
vote
1
answer
118
views
Publishing to github packages using semantic release from an Nx Repository
I'm new to GitHub Packages (or publishing NPM packages in general) and am trying to publish packages to my private repository using semantic release following this excellent blog post.
However, I'm ...
0
votes
1
answer
382
views
NX how to pass arguments to target dependency
I have the project config set in the package.json as below:
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/dist"
...
0
votes
0
answers
136
views
typings/image.d.ts && cssmodule.d.ts not found in Vite build NX 16.5
Current Behavior
I have migrated from create-react-app to Vite.
Running the app & build locally works fine but when I try to deploy the changes via bitbucket pipeline I get this error.
Nx version: ...
2
votes
0
answers
77
views
Failed to resolve module specifier "module". when importing @microsoft/signalr into nx app created in angular
When I am using @microsoft/signalr in my angular monorepo with nx, I am getting below error -
Uncaught TypeError: Failed to resolve module specifier "module". Relative references must start ...
1
vote
0
answers
49
views
List NX targets
I can't find a command that lists the available NX targets from the command line. I'd expect something like nx list, but that lists plugins, not targets.
Currently the only way I can find what targets ...
1
vote
1
answer
412
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 ...
1
vote
1
answer
260
views
How do I resolve the following error: Cannot find module '@nx/node/src/executors/node/schema.json'
I'm running an Nx workspace and have a NestJs app that has worked just fine up until now. When I go to serve the app, I get the following error:
Error: Unable to resolve @nrwl/node:node.
Cannot find ...
0
votes
0
answers
95
views
Nrwl/nx angular project throws ivy/ngcc error when importing modules from a custom package
I'm working on moving the shared libs of my angular project to a separate package project, which will upload the packages to npm for the main project to download and reference. Before the migration, ...
1
vote
1
answer
147
views
nrwl NX , angular , nest project, how to make PWA for a specific angular app
I am building a monorepo using NX nrwl. I have an angular front end and a nestjs backend in the same repository..
To make the angular project to PWA, there is command with ng-add, but that doesn't ...
0
votes
0
answers
66
views
how to use assets in an angular library
In a microfront end architecture project. I have generated an angular library in which I have declared some components that must use images
To this end, in the same library I have created an assets ...
0
votes
1
answer
56
views
tsconfig alias not resolving at paths above baseUri
I'm working on a monorepo and have noticed that the tsconfig is not resolving paths that are above the current project.
Here's my project structure:
── apps
│ ├── sahl
│ │ ├── index.d.ts
│ │ ...
0
votes
0
answers
58
views
Is it possible to use Vite to build an nx remix app with proxyConfig?
I've been trying to set up Remix in an nx project with a Remix app inside it. I wanted to use Vite to set up ports and proxies, but when I configure it, the proxies work but it doesn't serve the main ...
2
votes
0
answers
430
views
How to collect code coverage from playwright to Sonar (Angular Project)
seeking help regarding the topic.
There is an Angular project built with nrwl that includes Playwright e2e tests. However, I am unable to extend the existing unit tests (which are Jest based and were ...
0
votes
0
answers
123
views
How to execute nx executor from my own executor?
I want to run some code after @nx/esbuild complete.
So I was thinking of doing my own plugin that runs @nx/esbuild and then doing my own logic there.
export default async function echoExecutor(
...