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

v51's expo-secure-store dependecy breaks web compatibility #183

Closed
jypa opened this issue May 17, 2024 · 4 comments
Closed

v51's expo-secure-store dependecy breaks web compatibility #183

jypa opened this issue May 17, 2024 · 4 comments
Labels
released This feature/bug fix has been released

Comments

@jypa
Copy link

jypa commented May 17, 2024

Describe the bug

expo-bugsnag v51.x added expo-secure-store as peer-depedency. This package doesn't work on the web platform and causes the app to crash on runtime.

A possible fix would be to use AsynStorage when running in the web platform.

Steps to reproduce

  1. Launch the app on the web

Environment

  • Bugsnag version: 51.0.0
  • Expo SDK version: 51
Error messages:
Uncaught TypeError: _ExpoSecureStore.default.getValueWithKeySync is not a function
@toniewypada
Copy link

Hi @jypa 👋 ,
Thanks for raising this issue. We're going to take a look at addressing this. We don't currently have an ETA we can share on when this will be available, but we will make sure to post any updates on this thread.

@clr182 clr182 added the backlog We hope to fix this feature/bug in the future label May 21, 2024
@giaset
Copy link

giaset commented Jun 4, 2024

Ended up patching the package like this:

    let deviceId
    if (Platform.OS === 'web') {
      deviceId = localStorage.getItem(DEVICE_ID_KEY)
      if (!deviceId || !cuid.isCuid(deviceId)) {
        deviceId = cuid()
        localStorage.setItem(DEVICE_ID_KEY, deviceId)
      }
    } else {
      const storeOptions = {
        requireAuthentication: false,
        keychainAccessible: SecureStore.ALWAYS_THIS_DEVICE_ONLY
      }
      
      deviceId = SecureStore.getItem(DEVICE_ID_KEY, storeOptions)
      if (!deviceId || !cuid.isCuid(deviceId)) {
        deviceId = cuid()
        SecureStore.setItem(DEVICE_ID_KEY, deviceId, storeOptions)
      }
    }

@yousif-bugsnag
Copy link
Contributor

yousif-bugsnag commented Jun 11, 2024

Hi @giaset, thanks for sharing this - please see the comment on the linked PR:
#185 (comment)

@yousif-bugsnag yousif-bugsnag added released This feature/bug fix has been released and removed backlog We hope to fix this feature/bug in the future labels Aug 29, 2024
@yousif-bugsnag
Copy link
Contributor

This is now fixed in v51.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

5 participants