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

Nx 19 fails migration from Nx 17 #26681

Closed
ErickRodrCodes opened this issue Jun 25, 2024 · 2 comments · Fixed by #26690
Closed

Nx 19 fails migration from Nx 17 #26681

ErickRodrCodes opened this issue Jun 25, 2024 · 2 comments · Fixed by #26690
Assignees
Labels

Comments

@ErickRodrCodes
Copy link

ErickRodrCodes commented Jun 25, 2024

          This has been fixed in latest Nx as part of: https://github.com/nrwl/nx/pull/23143

Originally posted by @Coly010 in #22878 (comment)

Apparently the issue is still present while migrating a Nx 17 project into a Nx 19

@Coly010 can you please verify this again?

image

@ErickRodrCodes ErickRodrCodes changed the title This has been fixed in latest Nx as part of: https://github.com/nrwl/nx/pull/23143 Nx 19 fails migration from Nx 17 Jun 25, 2024
@ErickRodrCodes
Copy link
Author

ErickRodrCodes commented Jun 25, 2024

after some debugging, I guess the problem is on the schematic of the migration:

this diff should change it:

function updateConfig(config: {
  browserTarget?: string;
  buildTarget?: string;
}): void {
-  if (config.browserTarget) {
+ if (config && config.browserTarget) {
    config.buildTarget ??= config.browserTarget;
    delete config.browserTarget;
  }
}

after that, my code was able to migrate successfully to 19:
image

@Coly010 Coly010 self-assigned this Jun 26, 2024
FrozenPandaz pushed a commit that referenced this issue Jun 26, 2024
… empty config #26681 (#26690)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The migration from `browserTarget` to `buildTarget` assumed config would
not be undefined.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The migration should check if config is undefined

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26681

(cherry picked from commit 81dced7)
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 Jul 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants