xaviergonz / mobx-keystone

A MobX powered state management solution based on data trees with first class support for Typescript, support for snapshots, patches and much more
https://mobx-keystone.js.org
MIT License
554 stars 25 forks source link

e.observable.object is undefined when using 0.57.0 on expo #237

Closed jeloagnasin closed 3 years ago

jeloagnasin commented 3 years ago

I created a repo with the simplest way to reproduce the error: https://github.com/jeloagnasin/mobx-keystone-issue.

When I was using mobx-keystone@0.57.0 on expo, I receive the following error:

TypeError: undefined is not an object (evaluating 'e.observable.object')

This error is located at:
    in App (created by ExpoRoot)
    in ExpoRoot (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in DevAppContainer (at AppContainer.js:121)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog
at [native code]:null in commitRootImpl
at [native code]:null in performSyncWorkOnRoot
at node_modules/react-native/Libraries/ReactNative/renderApplication.js:54:4 in renderApplication
at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run
at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:213:4 in runApplication
at [native code]:null in callFunctionReturnFlushedQueue

If I downgrade to mobx-keystone@0.54.0, it works fine.

expo install mobx-keystone@~0.54.0
xaviergonz commented 3 years ago

It seems to work for me with node 16 and the web version in the latest chrome (at least I can see the ·Open up App.tsx to start working on your app!" in chrome without any errors in the console). Where are you getting the error? An android device, ios...?

xaviergonz commented 3 years ago

Found that it actually happened on android. Please try 0.57.1

xaviergonz commented 3 years ago

I'll assume it was fixed. Please reopen if needed.