parse-community / Parse-SDK-JS

The JavaScript SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
1.32k stars 597 forks source link

TypeError: attempted to use private field on non-instance, js engine: hermes #2111

Open manufunk opened 4 months ago

manufunk commented 4 months ago

New Issue Checklist

Issue Description

If using react native and expo, I receive an error if I do something like const parseQuery = new Parse.Query("Config");. This happened after upgrading the parse library. It seems that 4.x is affected and also the 5.0.0

Steps to reproduce

I created a sample project that will end up in an error. Just use yarn install and then yarn run start. I tested on the android emulator via expo app. However same happens on ios.

Actual Outcome

The following error is thrown:

 ERROR  TypeError: attempted to use private field on non-instance, js engine: hermes
 ERROR  Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes

Expected Outcome

No such error. The sample shows that if switched back to 3.5.1, the error does not appear but it is very old.

Client

Sample for reproduction

example.zip

parse-github-assistant[bot] commented 4 months ago

Thanks for opening this issue!

dplewis commented 4 months ago

I believe this has been fixed via https://github.com/parse-community/Parse-SDK-JS/pull/2109

Can you try the latest alpha release?

cr0ybot commented 1 month ago

I ran into the same issue, and was only able to resolve it by downgrading to parse 4.2.0 as noted by this stack overflow answer. My app was still using 4.x anyways (I know I need to upgrade, but I also need to upgrade parse-server and mongodb before I can do that). This seems to be an incompatibility with Expo SDK 50+.