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 - Expo migration fails if not using app.json #25291

Closed
1 of 4 tasks
minuz opened this issue May 23, 2024 · 3 comments
Closed
1 of 4 tasks

NX 19 - Expo migration fails if not using app.json #25291

minuz opened this issue May 23, 2024 · 3 comments
Assignees
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@minuz
Copy link

minuz commented May 23, 2024

Current Behavior

When upgrading to NX 19 on a repo with @nx/expo, the migration update-19-0-0-change-webpack-to-metro fails to execute if the project is not using app.json to configure the expo project.
Expo offers the ability to use app.json | app.config.js | app.config.ts. See doco: https://docs.expo.dev/workflow/configuration/#properties

However, this migration explicitly targets only app.json

updateJson(tree, `${config.root}/app.json`, (appJson) => {

Expected Behavior

This should support all expo config files.

GitHub Repo

No response

Steps to Reproduce

  1. Create an NX repo using NX < 19
  2. Add an Expo project using @nx/expo
  3. Change the generated app.json to app.config.{js,ts}
  4. Run the migration using nx migrate latest && nx migrate --run-migrations
  5. The aforementioned migration update-19-0-0-change-webpack-to-metro will fail

Nx Report

NX   Report complete - copy this into the issue template

Node   : 18.20.2
OS     : darwin-arm64
pnpm   : 8.15.8

nx                 : 19.0.6
@nx/js             : 19.0.6
@nx/jest           : 19.0.6
@nx/linter         : 19.0.6
@nx/eslint         : 19.0.6
@nx/workspace      : 19.0.6
@nx/detox          : 19.0.6
@nx/devkit         : 19.0.6
@nx/eslint-plugin  : 19.0.6
@nx/expo           : 19.0.6
@nx/plugin         : 19.0.6
@nx/react          : 19.0.6
@nx/rollup         : 19.0.6
@nrwl/tao          : 19.0.6
@nx/web            : 19.0.6
@nx/webpack        : 19.0.6
typescript         : 5.4.5
---------------------------------------
Local workspace plugins:
	 @xemplo-mobile/repo-helpers

Failure Logs

NX   Running 'pnpm install --no-frozen-lockfile' to make sure necessary packages are installed

Lockfile is up to date, resolution step is skipped
Already up to date

> xemplo-mobile@0.0.1 postinstall /Users/fernando.baba/Dev/repos/xemplo-mobile
> git config core.hooksPath ./.git-hooks

Done in 2.8s

 NX   Running migrations from 'migrations.json', with each applied in a dedicated commit


 NX   Failed to run update-19-0-0-change-webpack-to-metro from @nx/expo. This workspace is NOT up to date!


 NX   Cannot find apps/xemplo/app.json

Pass --verbose to see the stacktrace.

Command failed: pnpm exec nx _migrate --run-migrations --create-commits

 NX   Command failed: pnpm exec nx migrate --run-migrations --create-commits

Pass --verbose to see the stacktrace.

Command failed: /var/folders/w2/z287vrz12dg87__2klcv2gtr0000gp/T/tmp-68226-OBZCT359Znc4/node_modules/.bin/nx _migrate --run-migrations --create-commits

Package Manager Version

pnpm 8.15.8

Operating System

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

Additional Information

No response

@FrozenPandaz FrozenPandaz added the scope: react-native Issues relating to React Native label May 23, 2024
@magic-ksenia
Copy link

magic-ksenia commented May 27, 2024

I'm facing the same issue running migrations in @nx/expo.
Updating to nx: 19.1.0
Node: 18.20.2
Yarn: 1.22.22
I need to use dinamic app.config.js.

...
 NX   Failed to run update-19-0-0-change-webpack-to-metro from @nx/expo. This workspace is NOT up to date!

 NX   Cannot find apps/vision-app/app.json

Pass --verbose to see the stacktrace.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Command failed: yarn nx _migrate --run-migrations
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 NX   Command failed: yarn nx migrate --run-migrations 

xiongemi added a commit that referenced this issue May 31, 2024
config.js

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

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #26118
#25291
#23233
@xiongemi
Copy link
Collaborator

fixed in pr #26137

FrozenPandaz pushed a commit that referenced this issue Jun 3, 2024
config.js

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

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #26118
#25291
#23233

(cherry picked from commit 2cb7ecb)
Copy link

github-actions bot commented Jul 1, 2024

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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

No branches or pull requests

4 participants