react-native: 0.47.1 Build iOS Error
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v: 0.47.1node -v: 8.2.1npm -v: 5.3.0yarn --version: 0.20.3
Then, specify:
- Target Platform: iOS
- Development Operating System: macOS
- Build tools: Xcode
Steps to Reproduce
- react-native init rn0471_build_ios_release_error_reproduce
- open .xcodeproj file
- edit scheme -> select “release” build configuration
- build & run in simulator
Expected Behavior
The project should be successfully build and run in the simulator
Actual Behavior
The project build failed
+ DEST=/Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app
+ [[ Release = \D\e\b\u\g ]]
+ BUNDLE_FILE=/Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app/main.jsbundle
+ node /Users/alekseypokhodnya/RubymineProjects/rn047-fail-test/rn0471reproduce/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app/main.jsbundle --assets-dest /Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app
/Users/alekseypokhodnya/RubymineProjects/rn047-fail-test/rn0471reproduce/node_modules/metro-bundler/src/lib/Terminal.js:141
this._nextStatusStr = util.format(format, ...args);
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (/Users/alekseypokhodnya/RubymineProjects/rn047-fail-test/rn0471reproduce/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/alekseypokhodnya/RubymineProjects/rn047-fail-test/rn0471reproduce/node_modules/react-native/local-cli/server/runServer.js:18:18)
at Module._compile (module.js:409:26)
+ [[ false != true ]]
+ [[ ! -f /Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app/main.jsbundle ]]
+ echo 'error: File /Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app/main.jsbundle does not exist. This must be a bug with'
error: File /Users/alekseypokhodnya/Library/Developer/Xcode/DerivedData/rn0471reproduce-fdeyxrhuiruhnzgprfosmoijckya/Build/Products/Release-iphonesimulator/rn0471reproduce.app/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2
Reproducible Demo
https://github.com/pohodnya/rn0471_build_ios_release_error_reproduce
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 25
@StevenGreenup you have just to manually edit the file
node_modules/babel-preset-react-native/configs/main.jsas suggested from @rpfaffman and it worksremove the last coma from
deleting trailing comma on line 40 of
node_modules/babel-preset-react-native/configs/main.jsand re-runningreact-native run-iosworked for me as a temporary workaroundshould be
Similar issue here:
TransformError: …/index.ios.js: Unexpected token ) (While processing preset: “…/node_modules/babel-preset-react-native/index.js”)
This same exception comes when I try to run react-native-git-upgrade. Something seems to be generally wrong, as this happens on a brand new project.
+1
experiencing the same issue on
run-androidaswell asrun-iosTransformError: …/Test/index.ios.js: Unexpected token ) (While processing preset: “…/Test/node_modules/babel-preset-react-native/index.js”)
RCTFatal __28-[RCTCxxBridge handleError:]_block_invoke _dispatch_call_block_and_release _dispatch_client_callout _dispatch_main_queue_callback_4CF CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE __CFRunLoopRun CFRunLoopRunSpecific GSEventRunModal UIApplicationMain main start 0x0
node 8.4.0 npm 5.3.0
“dependencies”: { “react”: “16.0.0-alpha.12”, “react-native”: “0.47.1” }, “devDependencies”: { “babel-jest”: “20.0.3”, “babel-preset-react-native”: “3.0.0”, “jest”: “20.0.4”, “react-test-renderer”: “16.0.0-alpha.12” }, “jest”: { “preset”: “react-native” }
@jordanmkoncz The error is
node_modules/react-native/Libraries/react-native/react-native-implementation.js: EISDIR: illegal operation on a directory, read. I’m also having this issue and I can’t find a successful solution for me …Thanks @rpfaffman Your solution worked. This should be fixed in f69638b56ff881ba687ec1c98ab3aebee6209a26. Try
npm update babel-present-react-nativeto pull the fix.@jarecsni @amerej @rdixonbhw
This issue is about a syntax error, I am having TransformError as you guys. Opened another issue about this. #15513
Still broken. Repro:
https://github.com/sospedra/RNAnimated
Ah yes absolutely, I’ll release today.
+1 I’m tired of seeing a red simulator. I’m new to react-native with a great idea in mind, but it seems I’m stuck until this is fixed.
@rpfaffman solution works!
can’t update using
npm update babel-present-react-native