-1
PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/xeliumtech/Library/Developer/Xcode/DerivedData/MyProject-dnhytywafolqjdfyogwnjlgwovis/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/MyProject.build/Release-iphoneos/MyProject.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'MyProject' from project 'MyProject')
    
error Cannot read properties of undefined (reading 'transformFile').
TypeError: Cannot read properties of undefined (reading 'transformFile')
    at /Users/xeliumtech/Documents/Project/Vouch/node_modules/metro/src/Bundler.js:95:34
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/xeliumtech/Documents/Project/Vouch/node_modules/metro/src/Bundler.js:14:24)
    at _next (/Users/xeliumtech/Documents/Project/Vouch/node_modules/metro/src/Bundler.js:36:9)
info Run CLI with --verbose flag for more details.
Command PhaseScriptExecution failed with a nonzero exit code

While run react native code by Xcode 14(Mac M1)its working fine because its on debug mode but while archive its showing error . I downgrade the node - version 14.18.1 I try with delete the node-module and pod file with lock file also and reinstall it. but sill facing same issue.

Engr.Aftab Ufaq
  • 3,356
  • 3
  • 21
  • 47
  • Does this answer your question? [Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile](https://stackoverflow.com/questions/69647332/cannot-read-properties-of-undefined-reading-transformfile-at-bundler-transfo) – Engr.Aftab Ufaq Jul 26 '23 at 12:46
  • this is the answer https://stackoverflow.com/a/74716575/9570734 – Engr.Aftab Ufaq Jul 26 '23 at 12:48

1 Answers1

0

If you use a M1 series Mac, you can try the following:

  1. Select Xcode Build Phases tab

  2. Expand the Bundle React Native code and images phase

  3. Change script like below:

cd $PROJECT_DIR/..
export NODE_BINARY=/opt/homebrew/bin/node
./node_modules/react-native/scripts/react-native-xcode.sh
LW001
  • 2,452
  • 6
  • 27
  • 36