Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
33 votes
1 answer
13k views

How to manage SCSS stylesheets across a monorepo with different libraries sharing variables?

I have an angular monorepo set up via Nrwl and am using Angular Material's theming, which uses SASS. I want the SCSS source files to import at the project level where I'll override default color ...
Kevin Beal's user avatar
  • 10.8k
18 votes
1 answer
11k views

Angular + Jest: Can't resolve all parameters for AppComponent: (?)

I am operating inside a Typescript Monorepo. I want to add an Angular 8 frontend with Jest testing to the Monorepo. But I am encountering some issues. I am using Angular CLI: 8.3.5 What I did I ...
Florian Ludewig's user avatar
17 votes
3 answers
10k views

Jest Projects in a Monorepo unable to find config files in projects

Having trouble setting up jest projects. Project A has some additional configuration that it runs (setupJest, creates some custom matchers, etc) that project B does not have. When I run jest I get ...
mycroft16's user avatar
  • 825
15 votes
2 answers
15k views

Include a package for some libs in Nrwl/Nx workspace

It seems like in a Nrwl/Nx workspace there is only a single package.json file. Now if we have multiple applications, each dependent on different packages, then we have to include all of those package ...
Esfandiar's user avatar
  • 350
14 votes
2 answers
11k views

Cannot find "lint" target for the specified project OR Data path "" must have required property 'lintFilePatterns'

After changing my project structure to a monorepo structure in Angular according to this tutorial, I encountered numerous config bugs that I managed to squash after lots of troubleshooting. The full ...
BingeCode's user avatar
  • 1,639
12 votes
2 answers
14k views

@nrwl/nx angular Run all test for coverage in a single test run to get all covered code in my mono repo

I'm running tests in multiple projects of my nx angular monorepo and would like to get a single code coverage report of all projects with all code files covert from the tests. The test-runs seems to ...
Richard Liebmann's user avatar
10 votes
5 answers
31k views

Uncaught SyntaxError: Cannot use 'import.meta' outside a module - Nx Monorepo

I created an angular nx monorepo and created two applications. When I start either of them I get the following error: I already saw some stackoverflow posts were the answers suggested to just add &...
Stefan's user avatar
  • 1,292
8 votes
2 answers
8k views

Angular Libraries Monorepo: Is it possible to use different versions for every library?

just a simple question I can't seem to find an answer for. I'm trying to build a monorepo which should be able to use angular-cli v8, but still being able to compile and build libraries (mainly ...
Michael Di Prisco's user avatar
8 votes
1 answer
4k views

How to pass arguments to ng-cli through nx affected:test?

I want to pass some arguments to ng test command when running affected projects (for CI purposes). For example: ng test --codeCoverage=true --watch=false --progress=false. How it can be done through ...
nickbullock's user avatar
  • 6,499
8 votes
1 answer
2k views

How to Integrate an Angular Application into a Monorepo with Bazel?

I've spent the last weeks building a Typescript monorepo, which can be built and deployed to Kubernetes using Bazel. But the final piece of the puzzle is integrating an Angular application in to the ...
Florian Ludewig's user avatar
7 votes
1 answer
2k views

Angular console log source is always instrument.js

I'm now running Angular 12.1.0 in NX Monorepo in latest version 12.6.5. For a long time (not just with the last version) I noticed the console logs from angular components in my system are marked as ...
George Knap's user avatar
  • 1,110
6 votes
2 answers
11k views

Is there a better way to build an Angular monorepo app with libraries?

I have several apps in my Angular monorepo project. Also there are about 5 libraries I've written to use across the apps. What I want to know is how to better build/architect these libraries. The ...
Sergey's user avatar
  • 7,536
6 votes
1 answer
2k views

Are Webpack 5 Module Federation micro frontends and Nx monorepos mutually exclusive?

I'm investigating micro frontend and monorepo architecture for an Angular 12 project. Webpack 5 recently became production ready and with it, Module Federation, Webpack's solution for micro frontends. ...
Kyle Vassella's user avatar
6 votes
0 answers
1k views

Wrong dependency is getting picked up in monorepo and with yarn workspaces

We just started to use monorepo and yarn workspaces for two of our main projects. One is originally built on Angular 11 and another is in React. We set up yarn workspaces, and on one project (Angular) ...
Alex A.'s user avatar
  • 2,557
5 votes
9 answers
7k views

Angular monorepo error TS6059: File 'ng-youtube-api.service.ngtypecheck.ts' is not under 'rootDir'. 'rootDir' is expected to contain all source files

I've created 3 angular libraries/packages: @example/ng-youtube-player containing a YoutubePlayerComponent and YoutubeApiService @example/ng-dailymotion-player containing a DailymotionPlayerComponent ...
Pieterjan's user avatar
  • 3,526
5 votes
1 answer
736 views

npm publish only if changed in angular monorepo

I have an angular monorepo with an "app" and a library, which is published as it's own npm package. This is done automatically on a CI environment. Until now, the library and the app have been ...
Christof's user avatar
  • 3,887
5 votes
1 answer
1k views

Error: Cannot find module '@nrwl/workspace/src/utilities/perf-logging'

I have try run Angular project of nxMonrepo and I have already install all node_modules and it didnot show any error when I try to run PS C:\Users\Dell\Desktop\MEANAPP\EAAPP> nx migrate --run-...
Abdul Haseeb's user avatar
5 votes
0 answers
217 views

@ngrx/effects : Organizing effects in separate Angular libraries properly

We are using several consumer-facing Angular SPAs that contain features which are identical but also different [as you would expect]. The root store reducer for each SPA are similar but slightly ...
Bjorn Harvold's user avatar
4 votes
2 answers
983 views

running ionic generate page inside NX monorepo angular

i am inside a NX monorepo, its working on angular. I have installed Ionic as pre instructions given on link. Ionic is working ok, But i cant use commands like ionic generate page --project=sales-app, ...
raju's user avatar
  • 6,674
4 votes
2 answers
2k views

NX Monorepo (NestJS/Angular)

I'd like to create a monorepo to manage a fullstack application with a NestJS backend and an Angular frontend that share a package called "shared". I'd like to do this using NX. Actually I ...
Platus's user avatar
  • 1,407
4 votes
3 answers
4k views

Why i am getting the following error 'Data path "/error" must be string.' on building my library in angular?

When i am trying to build my angular-library i am getting the following error: Schema validation failed with the following errors: Data path "/error" must be string.; I am getting this error ...
MarcelSauter's user avatar
4 votes
1 answer
2k views

Nx Angular - no such file or directory, open 'd:\...\TheApp\Source\Angular.Apps/apps/app-client/src/environments/environment.prod.ts'

I've spent some time working on a PowerShell project to automate some builds of my C# and Angular apps which are based on @Nrwl NX monorepos. Prior to this everything worked fine, but when I try a ...
Jacques's user avatar
  • 7,065
4 votes
2 answers
3k views

Angular MonoRepo Nx - use library in application

Situation: I am quite new to Angular and want to create an Angular workspace with multiple applications and libraries. I followed this tutorial to create an Angular workspace with Nx in form of a ...
the_chimp's user avatar
  • 245
3 votes
1 answer
1k views

NX one Ui-lib or create a lib for each Ui usecase

So I want to create shared libs in my angular project. I have listed down below my two approaches, which both do their job, but I don't which is the better one, that I should implement. #1 One Ui lib ...
dewey's user avatar
  • 979
3 votes
1 answer
991 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 ...
Jay's user avatar
  • 386
3 votes
1 answer
973 views

Error testing Typescript files with Open WC Karma-ESM plugin

I ran the test as sudo, i.e. sudo npm run test ....and it worked. Go figure! Anyone care to venture a guess as to why that would be the case? I'm using the open web components karma-esm plugin to ...
fumeng's user avatar
  • 1,800
3 votes
4 answers
5k views

How to host assets with Module Federation on Angular and Nx monorepo

I need to make assets (png, svg images, fonts) from Angular remote applications available also in host applications of Webpack Module Federation. Below are long steps to reproduce - not necessary to ...
Kichrum's user avatar
  • 607
3 votes
0 answers
681 views

Using icons from NX shares assets lib in project's styles url attribute value

In my monorepo I implemented NX shared assets library for storing icons. This lib can be used across multiple applications inside this monorepo. This mentioned librabry contains set of svg icons and ...
Daniel Dvonč's user avatar
3 votes
0 answers
119 views

Share code between Angular and React with Yarn Workspaces does not work correctly

I have created a monorepo with yarn workspaces and initialized 3 packages: react-app angular-app shared (package.json name @monorepo/shared) angular-app and react-app include @monorepo/shared as a ...
Juliane Mohr's user avatar
3 votes
0 answers
330 views

Angular Monorepo: How to resolve circular dependencies of two coupled modules (httpservice logs what is sent/sending all logs using httpservice)

General information Angular v10.x NRWL 10.x Monorepo containing multpile apps and libs Situation We're using multiple modules in our repository, The following two are troublesome: CoreModule ...
Chonsu's user avatar
  • 185
2 votes
2 answers
3k views

Getting "Unable to import class CommonModule" error while importing a one library into another library

Nx serve throws below error when I used Icon lib inside Button lib. enter image description here Em*-Icon's module** import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { ...
sathish's user avatar
  • 29
2 votes
2 answers
958 views

How to import local monorepo typescript package in Angular apps?

I'm trying to integrate an Angular project into a PNPM workspace monorepo that mainly contains react app. Here is the directory structure |-apps | |-react-app | | |-package.json | | | |-angular-...
hskris's user avatar
  • 349
2 votes
1 answer
2k views

Could not find bootstrapApplication call in apps/product/src/main.ts while adding @angular/material with Nrwl Nx Mfa Workspace

I have created a project with the Nx Mfa schema as follows npx create-nx-workspace fetebird --preset=empty npm install --save-dev @nrwl/angular nx g @nrwl/angular:host host --remotes=product,...
San Jaisy's user avatar
  • 16.4k
2 votes
1 answer
2k views

NX Monorepo (14.3.6) no support for $localize (Angular localize)

Here is the case I have installed latest version of nx monorepo (npx create-nx-workspace@latest). Currently latest version of nx is (14.3.6). After this I have added angular localization package (npm ...
Hivaga's user avatar
  • 4,296
2 votes
1 answer
5k views

How to build a NestJs api from a mono repository

I am working on a project where we are storing our code in a monorepo that is "managed" by nrwl. The repo contains a couple angular apps and a couple nestjs apis. Now we want to dockerize the apis to ...
Woozar's user avatar
  • 1,090
2 votes
1 answer
3k views

Why my build version of NestJS for production inside nx monorepo does not include database?

I created an nx monorepo (Angular + NestJS) with mysql database. Each time I build it for production using npx nx build or npx nx run api:build:production, I see success message (NX SUCCESS Running ...
Ashur's user avatar
  • 31
2 votes
1 answer
107 views

How to change text in the component base on the project I runs?

I build auth lib in my nx monorepo. The auth lib contains LoginComponent (smart) and LoginFormComponent (dumb). And I load the lib as lazy by using loadChildren to load auth.module and inside this ...
Jon Sud's user avatar
  • 11.3k
2 votes
1 answer
194 views

With an Angular Monorepo Can't bind to 'ngIf' since it isn't a known property of 'div' and 'my-selector' is not a known element

I've seen other posts like this one on Stack Overflow but I don't think this is a duplicate. I have built up an Angular 11 monorepo with three private libraries and an application. Everything seems to ...
vicatcu's user avatar
  • 5,687
2 votes
1 answer
1k views

Mono Repo: Accessing typescript file outside of project gives 'pos' undefined error

I am trying to build an Angular mono repo. However, when I try to run lerna run start --scope=@demo/core-app I get the following error: [error] TypeError: Cannot read property 'pos' of undefined ...
Shyamal Parikh's user avatar
2 votes
1 answer
215 views

Using Ionic Elements in Monorepo Library in Template causes Application level "No provider for ChangeDetectorRef" Error

I'm trying to migrate to a monorepo structure for my Ionic 5 projects. In order to re-use my Ionic / Angular components and services across several projects in this monorepo, I'm trying to separate ...
vicatcu's user avatar
  • 5,687
2 votes
0 answers
91 views

NX ENOENT: no such file or directory, scandir ''

I use an NX monorepo, and I would like to build my frontend app. I get the following error: NX ENOENT: no such file or directory, scandir ''. I found some similar questions, but mine differs, as ...
nabsabt's user avatar
  • 47
2 votes
0 answers
2k views

NX: How to build all libraries belonging to a grouping folder

I have developed a library "A" made of several modules ("x", "y", "z") with the following folders structure: project + apps - libs + A - B - x ...
smartmouse's user avatar
  • 14.2k
2 votes
0 answers
580 views

NX monorepo in a dotnet Angular project

I am doing some research for a new project. This project will use .NET/C# for the backend and now I am investigating about the best way to integrate the frontend in the same repository. There will be ...
chenny's user avatar
  • 921
2 votes
0 answers
1k 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 ...
smartmouse's user avatar
  • 14.2k
2 votes
0 answers
948 views

Storybook: Does not document Angular components (No code available)

I have a Nx, Strorybook with Angular set up. The Storybook docs does not documenting my angular components. This is my webpack configuration: main.js const TerserPlugin = require('terser-webpack-...
The Rock's user avatar
  • 353
2 votes
0 answers
2k views

Micro Frontend configuration - nx nrwl monorepo

Configuration stack: Angular 13, Module Federation, Nx Monorepo, ngx-build-plus According to: Angular Enterprise book by Manfred Steyer Error: ChunkLoadError: Loading chunk default-...
profiler's user avatar
  • 607
2 votes
0 answers
1k views

How to share a single styles.css file in a v13 nx and angular monorepo

I am upgrading an nx / angular monorepo to nx 13.10. I am wondering if it is possible to relocate the built styles.1234etc.css file to a directory dist/styles, which is what we had been doing in older ...
sboggs11's user avatar
  • 190
2 votes
0 answers
371 views

Unable to create NX library for styles only

I am looking at the following example: https://github.com/nrwl/nx-examples/tree/nx-v5-example I am trying to figure out how the styles library was added. What is the command I need to run?
jmogera's user avatar
  • 1,749
2 votes
2 answers
784 views

Production build fails when using a shared component in Ionic app

I've a monorepo created by Nrwl Nx tool. The monorepo already contains one Angular web app and now i want to move my Ionic App to the existing monorepo. the structure of workspace is, apps/ -> ...
DP63's user avatar
  • 67
1 vote
2 answers
7k views

Ng add @nrwl/workspace throws Cannot read property 'paths' of undefined

I just make a project with the angular cli and then run the command "ng add @nrwl/workspace" to change it to a nrwl workspace. But I am getting the following error "Cannot read property ...
Haso's user avatar
  • 11