Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to 14 - Creation of development configuration #10259

Closed
john-waitforit opened this issue May 12, 2022 · 2 comments · Fixed by #10261
Closed

Migration to 14 - Creation of development configuration #10259

john-waitforit opened this issue May 12, 2022 · 2 comments · Fixed by #10261

Comments

@john-waitforit
Copy link
Contributor

Current Behavior

When migrating to v14 the migration script to create a development configuration can fail with some configurations

Expected Behavior

The migration script should work in most cases when people migrate NX

Steps to Reproduce

Given a project.json like this one:

{
    root: 'apps/example',
    projectType: 'application',
    targets: {
      build: {
        executor: '@nrwl/web:webpack',
        defaultConfiguration: 'production',
        configurations: { production: { sourceMap: false } },
      },
      serve: {
        executor: '@nrwl/web:dev-server',
      },
    },
}

The migration script called add-default-development-configurations fails to execute because the serve target does not have a configurations key.

Failure Logs

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

Environment

NX report
 Node : 16.13.1
   OS   : darwin arm64
   yarn : 1.22.17

   nx : 14.1.1
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.1.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.1.1
   @nrwl/eslint-plugin-nx : 14.1.1
   @nrwl/express : Not Found
   @nrwl/jest : 14.1.1
   @nrwl/js : 14.1.1
   @nrwl/linter : 14.1.1
   @nrwl/nest : Not Found
   @nrwl/next : 14.1.1
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 14.0.3
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.1.1
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.1.1
   @nrwl/web : 14.1.1
   @nrwl/workspace : 14.1.1
   typescript : 4.6.2
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
   	 @ngrx/component-store: 13.0.2
   	 @ngrx/effects: 13.0.2
   	 @ngrx/entity: 13.0.2
   	 @ngrx/router-store: 13.0.2
   	 @ngrx/schematics: 13.0.2
   	 @ngrx/store: 13.0.2
   	 @ngrx/store-devtools: 13.0.2
   	 @storybook/angular: 6.4.19

Fix

I'm opening a PR to fix this :)

@nagad814
Copy link

npm i webpack --save-dev, fixed the issue for me

john-waitforit added a commit to john-waitforit/nx that referenced this issue May 12, 2022
john-waitforit added a commit to john-waitforit/nx that referenced this issue May 12, 2022
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants