expo icon indicating copy to clipboard operation
expo copied to clipboard

Subtypes are no more supported since expo-document-picker 11.3.0

Open TomCorvus opened this issue 1 year ago • 5 comments

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

Capture d’écran 2023-05-02 à 10 35 44

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

TomCorvus avatar May 02 '23 09:05 TomCorvus

@alanjhughes Do you have more information to make it works again? SDK49 is released but this problem persists.

TomCorvus avatar Jul 07 '23 07:07 TomCorvus

/cc @lukmccall @brentvatne

SimenB avatar Jul 12 '23 10:07 SimenB

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.

expo-bot avatar Jul 12 '23 14:07 expo-bot

FWIW, this only seems to be an issue on iOS for us - Android happily accepts application/pdf.

SimenB avatar Jul 12 '23 14:07 SimenB

Yup, was wondering which platform it's on so I tested both and was able to repro on iOS – looking at this now.

aleqsio avatar Jul 12 '23 14:07 aleqsio

🎉

SimenB avatar Jul 13 '23 11:07 SimenB

Thanks @aleqsio 💪

TomCorvus avatar Jul 13 '23 13:07 TomCorvus

When can we expect a release of this? 🙂

SimenB avatar Jul 13 '23 21:07 SimenB