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

TypeError: Cannot set property 'AttributeMap' of undefined #64

Open
matt-dalton opened this issue Apr 22, 2021 · 2 comments
Open

TypeError: Cannot set property 'AttributeMap' of undefined #64

matt-dalton opened this issue Apr 22, 2021 · 2 comments

Comments

@matt-dalton
Copy link

Our Sailthru SDK has been working fine and we've had no problems (5.1.0), so I think everything is installed correctly.

I moved our log out function to a file that is initialised much earlier on in the app lifecycle, it looks like this:

import SailthruMobile from 'react-native-sailthru-mobile'

 clearAsyncStorageAndLogout = async () => {
   //... other logic
   await SailthruMobile.clearDevice(SailthruMobile.DeviceValues.ClearAll) 
 }

Previously this was in an app component (so loaded much later on), and was working fine. However, now the app doesn't load and I get this error:

TypeError: Cannot set property 'AttributeMap' of undefined

Am I possibly missing a setup step? Or is there some kind of race condition that could prevent the SDK from setting up before it's loaded?

@matt-dalton
Copy link
Author

My bad...turned out to be an upgrade issue. My native dependency was out of date, so I had to run pod update SailthruMobile

@matt-dalton
Copy link
Author

Actually...this is now happening again. I've re-installed 3 times and am still getting the same issue as described above. Any idea why the Native Module would be returning undefined? I've followed all the install instructions.

@matt-dalton matt-dalton reopened this Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant