question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot pass in multiple configurations using -c since nx 11

See original GitHub issue

Current Behavior

nx run app-api:build -c=production,dev-environment 

Could not find configuration "production,dev-environment" in app-api:build. Valid configurations are: dev-environment, production

Expected Behavior

should be the same as running

nx run app-api:build --configuration=production,dev-environment

this works and applies both production and dev-environment configurations

Steps to Reproduce

create multiple configurations for a app. then apply them both using

-c=config1,config2

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

Could not find configuration “production,dev-environment” in app-api:build. Valid configurations are: dev-environment, production

Environment

Node : 14.15.1
  OS   : darwin x64
  yarn : 1.22.10
  
  nx : Not Found
  @nrwl/angular : 11.0.4
  @nrwl/cli : 11.0.4
  @nrwl/cypress : 11.0.4
  @nrwl/devkit : 11.0.4
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 11.0.4
  @nrwl/linter : 11.0.4
  @nrwl/nest : 11.0.4
  @nrwl/next : Not Found
  @nrwl/node : 11.0.4
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 11.0.4
  @nrwl/web : Not Found
  @nrwl/workspace : 11.0.4
  typescript : 4.0.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
raphael22commented, Feb 8, 2022

Please reconsider discussion about this. Not having to copy/paste huge chunk of configuration to change only one parameter is kind of big deal that was resolved in Angular CLI.

@vsavkin Running the command twice will not solved this. Since fileReplacements behavior change in Angular 11 and not longer replace file not imported in code we have to rely on “assets” override. Which can’t be override in NX without multi-configuration so we are stuck with copy/paste of every configuration.

10reactions
georgieecommented, Jan 28, 2021

I’v been watching this issue for some time and I would like to second the opinion by @chrisfitz & @henry-martinez on this topic.

@vsavkin has been pretty clear about this topic:

Given that the use case is somewhat rare and the workaround is straightforward (run the command twice), from now on we will only support one configuration per run.

What gives me hope is this:

If the workaround doesn’t around, please reopen the issue let me know the details, and I’ll reassess the situation.

The proposed workaround does not fit the problem. It’s about the configuration composition feature and not about running multiple builds. We use this feature extensively for our enterprise client and it’s the official suggestion by Angular:

For production builds, you can use configuration composition to execute both configurations:

ng build --configuration=production,fr

via https://angular.io/guide/i18n

This will take the production config and puts the partial config for the locale fr on top of it. This is clearly not “building twice”.

Workaround: We are also forced to use ng directly as nx chose to break this behavior. Expected Behavior: nx should reflect the configuration composition from the Angular CLI

Read more comments on GitHub >

github_iconTop Results From Across the Web

NXcustom for NX11.0 (NX110custom) - Siemens Communities
The environment variable UGII_CUSTOM_DIRECTORY_FILE is being set in Windows for "C:\Program Files\Fibersim 14.1.0\custom_dirs.dat". In the NX110env.dat file ...
Read more >
The ultimate migration guide to angular-eslint, ESLint and Nx 11
Let's explore different workspace configurations and discuss a few caveats. This guide includes options to use NPM, PNPM, or Yarn, Jest or Karma ......
Read more >
NX default preferences — Engineering Computer Network
The default load assembly option is to look for the parts in the same folder as the assembly, but to work, load assembly...
Read more >
Configure RADIUS and TACACS+ for GUI and CLI ... - Cisco
This document describes how to configure a 9800 Wireless LAN Controllers ... In case you have multiple RADIUS servers that can be used...
Read more >
Jest finds tests but doesn't collect coverage - Stack Overflow
The quick fix I said in my comment, using --watchAll instead, eg: react-scripts test --coverage --watchAll . Just for future reference, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found