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 update-vite-config incorrectly updates configuration #20921

Closed
1 of 4 tasks
paustint opened this issue Dec 25, 2023 · 0 comments · Fixed by #23364
Closed
1 of 4 tasks

Migration update-vite-config incorrectly updates configuration #20921

paustint opened this issue Dec 25, 2023 · 0 comments · Fixed by #23364
Assignees
Labels
scope: bundlers Issues related to webpack, rollup type: bug

Comments

@paustint
Copy link

paustint commented Dec 25, 2023

EDIT: Potentially resolved by this? #20693 I did not try it to confirm.

Current Behavior

update-vite-config migration updated my custom plugin instead of the actual vite configuration.

In addition, worker plugins should have been updated to a function instead of an array as part of migration for this vite breaking change

Expected Behavior

The vite configuration should have correctly identified the configuration, and not other non-configuration data within the file.

GitHub Repo

https://github.com/jetstreamapp/jetstream/tree/v3.7.0

Steps to Reproduce

  1. On provided repository, upgrade nx npx nx migrate latest
  2. Run yarn
  3. Delete update-17-2-7 from the migration file to workaround Migration "update-17-2-7" fails if a project does not have .eslintrc.json #20920 since that issue is irrelevant here.
  4. Run npx nx migrate --run-migrations
  5. Observe the vite.config.ts

image

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 18.16.0
   OS     : darwin-arm64
   yarn   : 1.22.19
   
   nx                 : 17.2.7
   @nx/js             : 17.2.7
   @nx/jest           : 17.2.7
   @nx/linter         : 17.2.7
   @nx/eslint         : 17.2.7
   @nx/workspace      : 17.2.7
   @nx/cypress        : 17.2.7
   @nx/devkit         : 17.2.7
   @nx/eslint-plugin  : 17.2.7
   @nx/express        : 17.2.7
   @nx/next           : 17.2.7
   @nx/node           : 17.2.7
   @nx/plugin         : 17.2.7
   @nx/react          : 17.2.7
   @nx/storybook      : 17.2.7
   @nrwl/tao          : 17.2.7
   @nx/vite           : 17.2.7
   @nx/web            : 17.2.7
   @nx/webpack        : 17.2.7
   typescript         : 5.2.2
   ---------------------------------------
   Community plugins:
   @mands/nx-playwright : 0.6.2
   nx-electron          : 15.0.0
   ---------------------------------------
   Local workspace plugins:
         @jetstream/workspace-plugin

Failure Logs

No response

Package Manager Version

yarn 1.22.19

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@jaysoo jaysoo added the scope: bundlers Issues related to webpack, rollup label Dec 27, 2023
FrozenPandaz pushed a commit that referenced this issue May 14, 2024
…3364)

<!-- 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` -->

## Current Behavior
<!-- This is the behavior we have today -->
The migration to update vite config is incorrectly matching other object
literal and arrow functions

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure more accurate updating of vite config file

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

Fixes #20921

(cherry picked from commit 88297dd)
Coly010 added a commit that referenced this issue May 15, 2024
…3364)

<!-- 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` -->

## Current Behavior
<!-- This is the behavior we have today -->
The migration to update vite config is incorrectly matching other object
literal and arrow functions


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure more accurate updating of vite config file

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

Fixes #20921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants