react-native-schemes-manager icon indicating copy to clipboard operation
react-native-schemes-manager copied to clipboard

fix-script fails if no debug configuration given

Open kevinsperrine opened this issue 6 years ago • 6 comments

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)

kevinsperrine avatar Mar 12 '18 18:03 kevinsperrine

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.

thekevinbrown avatar Apr 01 '18 03:04 thekevinbrown

Try remove yarn.lock and run yarn again.

Thunderbird7 avatar Apr 04 '18 04:04 Thunderbird7

+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

lc3t35 avatar Aug 11 '18 13:08 lc3t35

Got the same error TypeError: mappings[sourceBuildConfig] is not iterableand @lc3t35 suggestion to add empty array for ´Debug` fixed it.

hasanen avatar Sep 16 '18 20:09 hasanen

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 avatar Oct 20 '18 18:10 kevinEsherick

@kevinEsherick that'd be great.

thekevinbrown avatar Feb 15 '19 05:02 thekevinbrown