Open jypa opened 1 month ago
Hi @jypa :wave: , 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.
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)
}
}
Hi @giaset, thanks for sharing this - please see the comment on the linked PR: https://github.com/bugsnag/bugsnag-expo/pull/185#issuecomment-2161042749
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
Environment
Error messages:
``` Uncaught TypeError: _ExpoSecureStore.default.getValueWithKeySync is not a function ```