expo
expo copied to clipboard
Subtypes are no more supported since expo-document-picker 11.3.0
Minimal reproducible example
https://snack.expo.dev/@userfront/react-native-example
Summary
Since expo-document picker 11.3.0, we can't specify subtypes in params.
For example:
await DocumentPicker.getDocumentAsync({ type: 'application/pdf' })
or
await DocumentPicker.getDocumentAsync({ type: ['application/pdf'] })
causes this error:
Error: The 1st argument cannot be cast to type DocumentPickerOptions
→ Caused by: Cannot cast '(
"application/pdf"
)' for field 'type' of type Array<MimeType>
→ Caused by: 'application/pdf' is not present in MimeType enum, it must be one of: '*/*', 'image/*', 'video/*', 'audio/*', 'text/*'
Downgrade to 11.2.2 and it works.
expo-document-picker 11.3.0 doesn't seem to be released on npm btw. expo-sharing too. https://www.npmjs.com/package/expo-document-picker https://www.npmjs.com/package/expo-sharing

Thanks!
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 13.3.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.13.0 - /usr/local/bin/node
Yarn: 3.5.0 - /usr/local/bin/yarn
npm: 8.19.3 - /usr/local/bin/npm
Watchman: 2022.09.12.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.12.0 - /Users/name/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9862592
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
npmPackages:
expo: ^48.0.15 => 48.0.15
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-native: ^0.71.7 => 0.71.7
react-native-web: ^0.19.4 => 0.19.4
npmGlobalPackages:
eas-cli: 0.8.1
expo-cli: 6.1.0
Expo Workflow: bare
@alanjhughes Do you have more information to make it works again? SDK49 is released but this problem persists.
/cc @lukmccall @brentvatne
Thank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
FWIW, this only seems to be an issue on iOS for us - Android happily accepts application/pdf
.
Yup, was wondering which platform it's on so I tested both and was able to repro on iOS – looking at this now.
🎉
Thanks @aleqsio 💪
When can we expect a release of this? 🙂