Parse-SDK-JS
Parse-SDK-JS copied to clipboard
Parse SDK 4.3.1 is not working with React Native / Expo
When i try to use Parse SDK with the examples shown in their documentation. But it keeps giving this error...
TypeError: Cannot convert undefined value to object, js engine: hermes
I think none of 4+ versions of SDK works... 3.4.0 version seems to work... but its pretty old...
also you can not import parse/react-native.js as shown in the example / documentation...
you need to place the full path, otherwise it does not seem to work too... You need to import like you see below
import Parse from './node_modules/parse/react-native.js';
Thanks for opening this issue!
Any update on this? Parse 3.4 is working.
I get the same error. Any update?
I'm using 4.1 with React Native. I'm not using the react native version but the normal browser one. For React Native version just make sure you have the async storage installed (https://reactnative.dev/docs/asyncstorage). It is not a built-in feature of RN anymore. That might be the issue.
To use the browser version, you need a sync storage. I use MMKV (https://github.com/mrousavy/react-native-mmkv) and just built a small localstorage "polyfill" using it. Works great and I just import * as Parse from 'parse';
as you normally would.
I tried to debug this problem including using different EventEmitter implementations. I could not get it to work. The problem is related to PR https://github.com/parse-community/Parse-SDK-JS/pull/1999. Locally I started from the current release branch, reverted the merge of this PR and got working LiveQuery connections again in my React Native project. I pushed my changes to https://github.com/martinpfannemueller/Parse-SDK-JS/tree/release.
The problem with this PR seems to be that the EventEmitters are not properly initialized when they are used. Hence, the registry objects inside the used emitter was undefined.
During my debugging I could see that this issue is also related to https://github.com/parse-community/Parse-SDK-JS/issues/2082.
@martinpfannemueller I opened a PR to address this issue. https://github.com/parse-community/Parse-SDK-JS/pull/2109 Can you try it out in your project and let me know if it works for you?
@dplewis I just tested your updated code. The live query connection is working fine again for me. Thanks for the quick fix!
@martinpfannemueller No problem! Thank you for testing and debugging.
Completed by https://github.com/parse-community/Parse-SDK-JS/pull/2109