Error setting `mode` as multi_process
Version: 3.0.2 OS: Android 14 Using new architecture
Error: Value is a number, expected a String
when using
import { MMKV, Mode } from "react-native-mmkv";
const database = new MMKV({ mode: Mode.MULTI_PROCESS });
Setting mode to MULTI_PROCESS (as a string) makes it work, but Mode enum is expected so Typescript complains.
Guten Tag, Hans here 🍻. It looks like ze issue you are experiencing might be related to how ze Mode enum is being interpreted.
Make sure you are importing ze enum correctly, and try using it as follows:
const database = new MMKV({ mode: Mode.MULTI_PROCESS });
If you are still having problems, could you please provide logs from adb logcat when ze error occurs? Ze logs will help mrousavy understand ze problem better.
Also, if you enjoy using this library and want to support it, consider becoming a sponsor here. This can help mrousavy continue ze great work!
Looking forward to your response!
Note: If you think I made a mistake, please ping
@mrousavyto take a look.
Interesting. I'm guessing this is a codegen bug
fixed in https://github.com/mrousavy/react-native-mmkv/pull/754 🔥