react-native-schemes-manager
react-native-schemes-manager copied to clipboard
fix-script fails if no debug configuration given
Steps to reproduce the behavior
Install plugin, but do not enter any Debug entries in package.json
"xcodeSchemes": {
"Release": ["ReleaseAlpha", "ReleaseBeta"]
}
Expected behavior
fix-scripts to run successfully. This can be fixed by passing an empty array into debug.
"xcodeSchemes": {
"Debug": [],
"Release": ["ReleaseAlpha", "ReleaseBeta"]
}
Actual behavior
/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/fix-libraries.js:33
for (const destinationBuildConfig of mappings[sourceBuildConfig]) {
^
TypeError: mappings[sourceBuildConfig] is not iterable
at updateProject (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/fix-libraries.js:33:48)
at utilities.updateProjectsMatchingGlob (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/fix-libraries.js:86:10)
at getFilesMatchingGlob (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/utilities.js:70:8)
at glob (/Users/chuck/Projects/aramis/node_modules/react-native-schemes-manager/src/utilities.js:45:5)
at f (/Users/chuck/Projects/aramis/node_modules/once/once.js:25:25)
at Glob.<anonymous> (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:151:7)
at Glob.emit (events.js:160:13)
at Glob._finish (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:197:8)
at done (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:182:14)
at Glob._processGlobStar2 (/Users/chuck/Projects/aramis/node_modules/glob/glob.js:637:12)
The thing about this is you don't actually need React Native Schemes Manager for release schemes as far as I'm aware. I'm happy to accept PRs to fix this, but that's why I haven't gone very deep in supporting this scenario.
Try remove yarn.lock
and run yarn
again.
+1, maybe just indicate in README that Debug: [] should be at least added in xcodeSchemes
"xcodeSchemes": {
"Debug": [],
"Release": []
}
script can run without "mappings[sourceBuildConfig] is not iterable" error with this config
Got the same error TypeError: mappings[sourceBuildConfig] is not iterable
and @lc3t35 suggestion to add empty array for ´Debug` fixed it.
Happened to me as well and the above fix worked. I can submit a PR to make a note in the README if you'd like, I think that would be enough to close this.
@kevinEsherick that'd be great.