Release Build bundle step fails with SyntaxError unexpected token in joi
See original GitHub issueThe release build fails with:
+ node /Users/johnk/dev/play/AwesomeProject/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/johnk/Library/Developer/Xcode/DerivedData/AwesomeProject-fosllkxhaydisjhbhqsdkxjddemd/Build/Intermediates.noindex/ArchiveIntermediates/AwesomeProject/BuildProductsPath/Release-iphoneos/AwesomeProject.app/main.jsbundle --assets-dest /Users/johnk/Library/Developer/Xcode/DerivedData/AwesomeProject-fosllkxhaydisjhbhqsdkxjddemd/Build/Intermediates.noindex/ArchiveIntermediates/AwesomeProject/BuildProductsPath/Release-iphoneos/AwesomeProject.app
/Users/johnk/dev/play/AwesomeProject/node_modules/@hapi/joi/lib/types/object/index.js:255
!pattern.schema._validate(key, state, { ...options, abortEarly:true }).errors) {
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/johnk/dev/play/AwesomeProject/node_modules/@hapi/joi/lib/types/func/index.js:5:20)
+ [[ false != true ]]
+ [[ ! -f /Users/johnk/Library/Developer/Xcode/DerivedData/AwesomeProject-fosllkxhaydisjhbhqsdkxjddemd/Build/Intermediates.noindex/ArchiveIntermediates/AwesomeProject/BuildProductsPath/Release-iphoneos/AwesomeProject.app/main.jsbundle ]]
+ echo 'error: File /Users/johnk/Library/Developer/Xcode/DerivedData/AwesomeProject-fosllkxhaydisjhbhqsdkxjddemd/Build/Intermediates.noindex/ArchiveIntermediates/AwesomeProject/BuildProductsPath/Release-iphoneos/AwesomeProject.app/main.jsbundle does not exist. This must be a bug with'
File /Users/johnk/Library/Developer/Xcode/DerivedData/AwesomeProject-fosllkxhaydisjhbhqsdkxjddemd/Build/Intermediates.noindex/ArchiveIntermediates/AwesomeProject/BuildProductsPath/Release-iphoneos/AwesomeProject.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
React Native version: System: OS: macOS 10.15.2 CPU: (8) x64 Intel® Core™ i7-3740QM CPU @ 2.70GHz Memory: 1.42 GB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.14.1 - /usr/local/bin/node Yarn: 1.21.1 - ~/dev/clypsy/client/mobile/clypsy/node_modules/.bin/yarn npm: 6.13.4 - /usr/local/bin/npm Watchman: 4.3.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 19, 22, 23, 24, 25, 26, 27, 28 Build Tools: 19.1.0, 20.0.0, 22.0.1, 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3 System Images: a…gle_apis | Google APIs Intel x86 Atom_64 …, a…gle_apis | Google APIs Intel x86 Atom_64 …, a…gle_apis | Google APIs Intel x86 Atom_64 … IDEs: Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5
Steps To Reproduce
- npx react-native init AwesomeProject
- open AwesomeProject in Xcode
- configure signing
- Select Product–>Archive
Describe what you expected to happen:
Project to build and generate an archive
Describe what happened:
Project builds successfully but then the react bundle fails with error noted above. NOTE: if I run the node bundle command manually on the command line it succeeds
Things tried:
I’ve tried deleting node_modules, clearing watchman cache and deleting DerivedData
Research seems to suggest that there is a bug in @hapi/joi version 15.0.1 and greater See: https://github.com/hapijs/joi/issues/1802
This project IS able to be built and run in debug mode.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
Hi ! I’ve got the error and solved it easily :
If you don’t have
nvm
, follow these steps here.For my project, RN uses an expired version of node using nvm (v7.7.2). This version doesn’t handle the “spread operator”. By removing it and installing the latest version of node (still using nvm), RN uses the good version and then the error gone.
I hope it’ll fix yours.
🤔👍🏽