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

按照 文档配置,结果报错 #76

Open
libbGit opened this issue Jun 19, 2019 · 6 comments
Open

按照 文档配置,结果报错 #76

libbGit opened this issue Jun 19, 2019 · 6 comments

Comments

@libbGit
Copy link

libbGit commented Jun 19, 2019

[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[Reaction@1]' Error: [serializr] Failed to find default schema for undefined

@seunlanlege
Copy link

yeah I think this has to do with react-native v0.59.9

@r3wt
Copy link

r3wt commented Jul 6, 2019

@pinqy520 I have same problem. i am using latest version of mobx with mobx-preact and mobx-persist. this error is being thrown and nothing is being persisted to localstorage

@shenopkss
Copy link

shenopkss commented Jul 25, 2019

Same mistake

[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[Reaction@1]', [Error: [serializr] expected modelSchema, got undefined]
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
- node_modules/mobx/lib/mobx.module.js:1723:26 in reportExceptionInDerivation
- node_modules/mobx/lib/mobx.module.js:1702:45 in track
- node_modules/mobx/lib/mobx.module.js:2047:16 in reactionRunner
- node_modules/mobx/lib/mobx.module.js:2035:26 in <unknown>
- node_modules/mobx/lib/mobx.module.js:1660:20 in runReaction
- node_modules/mobx/lib/mobx.module.js:1797:12 in runReactionsHelper
- node_modules/mobx/lib/mobx.module.js:1775:47 in reactionScheduler
- node_modules/mobx/lib/mobx.module.js:1804:84 in <unknown>
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:18527:14 in batchedUpdates$1
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:2611:31 in batchedUpdates
- node_modules/mobx/lib/mobx.module.js:1804:49 in reactionScheduler
- node_modules/mobx/lib/mobx.module.js:1780:22 in runReactions
- node_modules/mobx/lib/mobx.module.js:1644:24 in schedule
- node_modules/mobx/lib/mobx.module.js:2059:4 in reaction
- node_modules/mobx-persist/lib/index.js:47:24 in hydrate
* src/app.component.tsx:26:8 in <unknown>
- node_modules/metro/src/lib/polyfills/require.js:331:6 in loadModuleImplementation
* App.ts:1:0 in <unknown>
- node_modules/metro/src/lib/polyfills/require.js:331:6 in loadModuleImplementation
- node_modules/expo/AppEntry.js:4:0 in <unknown>
- node_modules/metro/src/lib/polyfills/require.js:331:6 in loadModuleImplementation
- node_modules/metro/src/lib/polyfills/require.js:197:45 in guardedLoadModule
* null:null in global code

package.json

"dependencies": {
    "@eva-design/eva": "^1.0.1",
    "ethers": "^4.0.33",
    "expo": "^33.0.6",
    "expo-analytics": "^1.0.8",
    "expo-camera": "^5.0.1",
    "expo-constants": "^5.0.1",
    "expo-media-library": "^5.0.1",
    "expo-permissions": "^5.0.1",
    "mobx": "^5.13.0",
    "mobx-persist": "^0.4.1",
    "mobx-react": "5.4.4",
    "react": "^16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-keyboard-aware-scroll-view": "^0.8.0",
    "react-native-ui-kitten": "^4.1.0",
    "react-navigation": "^3.11.0"
  }

@r3wt
Copy link

r3wt commented Jul 25, 2019

@shenopkss i was able to solve my issue by changing to @persist to @persist(type). it seems for all non primitives, you must now declare the type when using this latest version of mobx-persist. in my case one was an object and another an array that was causing my issues. changing to @persist('array') and @persist('object') respectively, solved my issue. hope it helps.

@r3wt
Copy link

r3wt commented Aug 18, 2019

and its stopped working again, and i am not sure why :/

@clauderobi
Copy link

clauderobi commented Dec 12, 2023

Same thing here.

And I am using @persist('number') for my 3 items I want to persist.

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

5 participants