nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.38k stars 2.33k forks source link

NX with React Native, trying to build the app to my device or trying to make a release build on xcode or on AndroidStudio #22665

Closed miguelpenaranda2019122 closed 5 months ago

miguelpenaranda2019122 commented 6 months ago

Current Behavior

Hi, i has been trying to implement somes apps on RN with a nx monorepo, all was working good but realized that when i try to build the app on debug mode on simulator, its works fine but on my device i get the next error:

image

At the same time when i am trying to make a release version on xcode or android studios, i am getting the same error.

Some extra info: I i realized too that if i try to start metro from the app and not with the nx application_name start, its works but when the application is opened, i get the same error again.

can i get some help, please?

Expected Behavior

I am hoping to make the release version with android studios and xcode.

GitHub Repo

No response

Steps to Reproduce

1.

Nx Report

the are not nx reports

Failure Logs

Node found at: /opt/homebrew/Cellar/node/21.6.1/bin/node

+ DEST=/Users/miguelcorreia/Library/Developer/Xcode/DerivedData/KeveMobile-eotzilmmbmnldidyrcecahpkovcf/Build/Products/Debug-iphoneos/KeveMobile.app

+ [[ ! -n '' ]]
+ [[ Debug = *Debug* ]]

+ [[ ! iphoneos == *simulator ]]

+ for num in 0 1 2 3 4 5 6 7 8

++ ipconfig getifaddr en0

+ IP=10.20.0.68

+ '[' '!' -z 10.20.0.68 ']'

+ break

+ '[' -z 10.20.0.68 ']'

+ echo 10.20.0.68

+ [[ -n '' ]]

+ case "$CONFIGURATION" in

+ [[ iphoneos == *simulator ]]

+ echo 'Bundling for physical device. Use the SKIP_BUNDLING flag to change this behavior.'

Bundling for physical device. Use the SKIP_BUNDLING flag to change this behavior.

+ DEV=true

+++ dirname ../../../node_modules/react-native/scripts/react-native-xcode.sh

++ cd ../../../node_modules/react-native/scripts/..

++ pwd

+ REACT_NATIVE_DIR=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native

+ PROJECT_ROOT=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/..

+ cd /Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/..

+ [[ -n /Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/../src/main.tsx ]]

+ :

+ source /Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native/scripts/node-binary.sh

++ '[' -z /opt/homebrew/Cellar/node/21.6.1/bin/node ']'

++ type /opt/homebrew/Cellar/node/21.6.1/bin/node

+ HERMES_ENGINE_PATH=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/Pods/hermes-engine

+ '[' -z '' ']'

+ HERMES_CLI_PATH=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/Pods/hermes-engine/destroot/bin/hermesc

+ [[ true != false ]]

+ [[ -f /Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/Pods/hermes-engine ]]

+ '[' -z '' ']'

+ export NODE_ARGS=

+ NODE_ARGS=

+ '[' -z '' ']'

+ export CLI_PATH=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native/cli.js

+ CLI_PATH=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native/cli.js

+ '[' -z '' ']'

+ BUNDLE_COMMAND=bundle

+ '[' -z '' ']'

+ COMPOSE_SOURCEMAP_PATH=/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native/scripts/compose-source-maps.js

+ [[ -z '' ]]

+ CONFIG_ARG=

+ BUNDLE_FILE=/Users/miguelcorreia/Library/Developer/Xcode/DerivedData/KeveMobile-eotzilmmbmnldidyrcecahpkovcf/Build/Products/Debug-iphoneos/main.jsbundle

+ EXTRA_ARGS=

+ case "$PLATFORM_NAME" in

+ BUNDLE_PLATFORM=ios

+ '[' '' = YES ']'

+ EMIT_SOURCEMAP=

+ [[ ! -z '' ]]

+ PACKAGER_SOURCEMAP_FILE=

+ [[ '' == true ]]

+ [[ true != false ]]

+ [[ true == false ]]

+ /opt/homebrew/Cellar/node/21.6.1/bin/node /Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native/cli.js bundle --entry-file /Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/ios/../src/main.tsx --platform ios --dev true --reset-cache --bundle-output /Users/miguelcorreia/Library/Developer/Xcode/DerivedData/KeveMobile-eotzilmmbmnldidyrcecahpkovcf/Build/Products/Debug-iphoneos/main.jsbundle --assets-dest /Users/miguelcorreia/Library/Developer/Xcode/DerivedData/KeveMobile-eotzilmmbmnldidyrcecahpkovcf/Build/Products/Debug-iphoneos/KeveMobile.app

(node:30679) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

(Use `node --trace-deprecation ...` to show where the warning was created)

                Welcome to Metro v0.80.8

              Fast - Scalable - Integrated

error src/main.tsx: Cannot read properties of undefined (reading 'includes').

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

    at module.exports (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/apps/keve-mobile/.babelrc.js:6:39)

    at parseSync (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/@babel/core/lib/parse.js:40:72)

    at Object.transform (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/@react-native/metro-babel-transformer/src/index.js:209:11)

    at module.exports.transform (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/react-native-svg-transformer/index.js:51:30)

    at transformJSWithBabel (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/metro-transform-worker/src/index.js:286:45)

    at Object.transform (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/metro-transform-worker/src/index.js:411:18)

    at transformFile (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/metro/src/DeltaBundler/Worker.flow.js:54:36)

    at Object.transform (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/metro/src/DeltaBundler/Worker.flow.js:30:10)

    at execFunction (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/jest-worker/build/workers/processChild.js:149:17)

    at execHelper (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/jest-worker/build/workers/processChild.js:137:5)

    at execMethod (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/jest-worker/build/workers/processChild.js:140:5)

    at process.messageListener (/Users/miguelcorreia/Documents/Nearsoft/@nearsoft-mobile-monorepo/node_modules/jest-worker/build/workers/processChild.js:44:7)

    at process.emit (node:events:519:28)

    at emit (node:internal/child_process:951:14)

info Run CLI with --verbose flag for more details.

the transform cache was reset.

Command PhaseScriptExecution failed with a nonzero exit code

Package Manager Version

yarn 1.22.19

Operating System

Additional Information

No response

kensaadi commented 5 months ago

I have a same problem

hx2ryu commented 5 months ago

I have same issue. 😢

kensaadi commented 5 months ago

I found a solution with:

kensaadi commented 5 months ago

Ok, I found the solution.

miguelpenaranda2019122 commented 5 months ago

Ok, I found the solution.

  • Comment the condition if build on .babelrc.js
  • After that when compile with xcode don't update the warning information. All running whell.

@kensaadi this works, thank you so much!!!

vaccarov commented 5 months ago

@kensaadi Alpha male right there, thanks. Bug was generated by NX_TASK_TARGET_TARGET being undefined somehow.

github-actions[bot] commented 4 months ago

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.