expo-cli
expo-cli copied to clipboard
uri-scheme: Cannot read properties of undefined (reading 'includes')
Summary
I tried to run a command:
yarn dlx uri-scheme add myapp
or
npx uri-scheme add myapp
Environment
expo-env-info 1.0.2 environment info: System: OS: macOS 12.3.1 Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - /private/var/folders/7r/rpcp4wz97jngh5x0nk88p5br0000gp/T/xfs-5b2a7593/node Yarn: 3.1.0 - /private/var/folders/7r/rpcp4wz97jngh5x0nk88p5br0000gp/T/xfs-5b2a7593/yarn npm: 8.5.0 - /usr/local/bin/npm Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 IDEs: Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild npmPackages: react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 Expo Workflow: bare
Please specify your device/emulator/simulator platform, model and version
iPhone 13 iOS 15.4
Error output
Aborting run
An unexpected error was encountered. Please report it as a bug:
TypeError: Cannot read properties of undefined (reading 'includes')
at /node_modules/uri-scheme/build/index.js:1:410051
at Array.some (<anonymous>)
at Object.appendScheme (/node_modules/uri-scheme/build/index.js:1:410018)
at Object.addAsync (/node_modules/uri-scheme/build/index.js:1:448244)
at Object.addAsync (/node_modules/uri-scheme/build/index.js:1:452504)
at async Command.<anonymous> (/node_modules/uri-scheme/build/index.js:1:443948)
Reproducible demo or steps to reproduce from a blank project
.
can you share the project you are running this in so we can reproduce?
here is the result of running this on an empty new project with an ios
directory for me:
Need to install the following packages:
uri-scheme
Ok to proceed? (y) y
› iOS: Added URI protocol "wojtekmaj" to project
adding an android directory (with expo prebuild -p android
) and running again:
╰─$ npx uri-scheme add wojtekmaj
› iOS: URI scheme "wojtekmaj" already exists in Info.plist at: [redacted]/Info.plist
› Android: Added URI protocol "wojtekmaj" to project
I think this just needs a null check. If you have <key>CFBundleURLTypes</key>
array item but without <key>CFBundleURLSchemes</key>
in your Info.plist (that's how it ended up looking when I changed some settings in Xcode), it will crash.