Note in the above code samples magic is initialised twice. There are no (documented or otherwise) methods for sharing the same magic instance throughout an app. I have tried to create some sort of provider/hook mechanism or even just export ing from one file and importing in the other and there is no difference.
I tried to setup a demo repo: https://github.com/jack828/TestApp-MagicSDKIssue and couldn't sucessfully use any of the SDK. I just get the error: TypeError: undefined is not an object (evaluating 'punycode.ucs2.decode') after importing the module.
✅ Prerequisites
magic-sdk
)?🐛 Description
I cannot use any methods provided by the Magic SDK due to this error.
🧩 Steps to Reproduce
🤔 Expected behavior
It should work.
😮 Actual behavior
All methods reject with the error:
Error: No available storage method found.
and a vague minified stack trace.I've googled as much as I can and found this relevant but useless issue: https://github.com/magiclabs/magic-js/issues/204
My google-fu leads me to believe it is a localforage error, which this package interfaces with AsyncStorage: https://www.npmjs.com/package/@aveq-research/localforage-asyncstorage-driver
💻 Code Sample
I cannot share the code for the project. However, a representation of the structure is provided below:
app-navigator.tsx
And in one of my screens:
Note in the above code samples magic is initialised twice. There are no (documented or otherwise) methods for sharing the same
magic
instance throughout an app. I have tried to create some sort of provider/hook mechanism or even justexport
ing from one file andimport
ing in the other and there is no difference.I tried to setup a demo repo: https://github.com/jack828/TestApp-MagicSDKIssue and couldn't sucessfully use any of the SDK. I just get the error:
TypeError: undefined is not an object (evaluating 'punycode.ucs2.decode')
after importing the module.🌎 Environment
@magic-sdk/react-native
yarn