Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setup-ios-permissions #752

Merged
merged 2 commits into from
Feb 27, 2023
Merged

Conversation

johnf
Copy link
Contributor

@johnf johnf commented Feb 27, 2023

Summary

npx react-native setup-ios-permissions was complianing it didn't exist. I discovered react-native.config.js was missing from the npm package.

I then had issues with cosmic config and was getting the following error

$ /Users/johnf/mobile/node_modules/.bin/react-native setup-ios-permissions
error cosmiconfig is not a function.
TypeError: cosmiconfig is not a function
    at Object.func (/Users/johnf/mobile/node_modules/react-native-permissions/react-native.config.js:20:32)
    at Command.handleAction (/Users/johnf/mobile/node_modules/@react-native-community/cli/build/index.js:108:23)
    at Command.listener [as _actionHandler] (/Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:482:17)
    at /Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1283:65
    at Command._chainOrCall (/Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1177:12)
    at Command._parseCommand (/Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1283:27)
    at /Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1081:27
    at Command._chainOrCall (/Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1177:12)
    at Command._dispatchSubcommand (/Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1077:23)
    at Command._parseCommand (/Users/johnf/mobile/node_modules/@react-native-community/cli/node_modules/commander/lib/command.js:1248:19)
info Run CLI with --verbose flag for more details.

Test Plan

What's required for testing (prerequisites)?

  • A basic app using the library

What are the steps to test it (after prerequisites)?

  • Ensured npm pack lists react-nartive.config.js
  • Tested the command against my app and that it modifies the pod file

Compatibility

OS Implemented
iOS
Android

Checklist

  • [X ] I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I added a sample use of the API in the example project (example/App.tsx)

@johnf johnf requested a review from zoontek as a code owner February 27, 2023 00:05
@zoontek zoontek merged commit eb322ab into zoontek:master Feb 27, 2023
@zoontek
Copy link
Owner

zoontek commented Feb 27, 2023

@johnf Good catch for the missing export. It was impossible to detect using this repository example directory.
But on my side, your change breaked cosmiconfig (I even tried to add a log):

Screenshot 2023-02-27 at 01 58 07

I will update to read-pkg instead of this package.

@zoontek
Copy link
Owner

zoontek commented Feb 27, 2023

I shipped 3.7.2 that fixes both issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants