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

Expo RN and ParseLiveQuery EventEmitter error #2082

Closed
manufunk opened this issue Feb 4, 2024 · 13 comments · Fixed by #2109
Closed

Expo RN and ParseLiveQuery EventEmitter error #2082

manufunk opened this issue Feb 4, 2024 · 13 comments · Fixed by #2109
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@manufunk
Copy link

manufunk commented Feb 4, 2024

New Issue Checklist

Issue Description

I updated a lot of dependencies in the last weeks and now I cannot get my application into a working state.
The problem seems to be related to the React Native Parse Live Queries but I did not find anything that could help me to debug this in a good way. I did not change anything in the config regarding Parse however I think it is due to the latest updates.

Actual Outcome

Screenshot 2024-02-04 at 15 50 55

Environment

Server

  • Parse Server version: 6.2.0

Client

  • Parse client version: 4.3.1
  • React Native 0.73.2
  • Expo 50

This is how my config is setup:

import Parse from "parse/react-native.js";
import AsyncStorage from "@react-native-async-storage/async-storage";

// Initialize Parse Backend Back4app
const parseConfig = {
  applicationId: "...",
  javascriptKey: "...",
  serverURL: "...",
  liveQueryServerURL: "...",
};

//Before using the SDK...
Parse.setAsyncStorage(AsyncStorage);
Parse.initialize(parseConfig.applicationId, parseConfig.javascriptKey);
Parse.serverURL = parseConfig.serverURL;
Parse.liveQueryServerURL = parseConfig.liveQueryServerURL;

// Enable cached user
Parse.User.enableUnsafeCurrentUser();

export default Parse;

And I do subscribe to the queries by:

parseQuerySub = await parseQuery.subscribe();

parseQuerySub.on("create", (myStuff: MyStuff) => {
    do stuff
}

Copy link

parse-github-assistant bot commented Feb 4, 2024

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:question Support or code-level question label Feb 6, 2024
@mtrezza
Copy link
Member

mtrezza commented Feb 6, 2024

I'm closing as it does not seem to be a Parse JS SDK issue given the current information.

Feel free to comment if you have any new information and we can re-open this issue.

@mtrezza mtrezza closed this as completed Feb 6, 2024
@andre-sonect
Copy link

Hi @mtrezza, clearly a Parse problem with expo. I have a spin up a new app using Ignite CLI and I don't use LiveQuery but just the fact of having Parse initialization I am having the exact error above. If I comment parse code no errors.

@mtrezza
Copy link
Member

mtrezza commented Feb 29, 2024

@andre-sonect Could you please add a detailed description of the issue and a sample code to reproduce this? The example from @manufunk seems to involve more code and LiveQuery, but it seems you could provide a more simple example? Also, which prior version of the Parse JS SDK works without issue and from which version onwards does the issue occur for you?

@mtrezza mtrezza reopened this Feb 29, 2024
@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed and removed type:question Support or code-level question labels Feb 29, 2024
@andresteves
Copy link

Hi @mtrezza, sure to be honest just create a new project using ignite cli and install parse. Then just initialize it on app.tsx and run it. It will show the error above. If you need an actual repo with the code I can also provide it.

@Jakub-Plan-d-k
Copy link

I am having the exact same issue, but without Expo.
I have been using Parse 4.2.0 successfully with RN 0.72.5.
When I upgraded RN to 0.73.5 I started to get the same message and I cannot get past Parse.initialize. I don't even use LiveQuery and yet this is where I get the exception.
I have checked it in multiple configurations and I always get the same result.
image

@Jakub-Plan-d-k
Copy link

Moreover, I went and directly commented out this line. After that, I was able to get past Parse.Initialize

image

@andresteves
Copy link

So @Jakub-Plan-d-k you were able to use Parse 4.2.0 successfully with RN 0.72.5? No errors like the one above?

@Jakub-Plan-d-k
Copy link

@andresteves that's right.
However for 0.73.5 I had to update to Kotlin. I am not sure whether those issues are caused by switch to Kotlin or RN update itself.
*By using Kotlin I mean in the MainApplication and MainActivity (+ReactNativeFlipper, which is gone in 0.73.5)

@andresteves
Copy link

@Jakub-Plan-d-k it can also be a Typescript issue since from one version to the other the version went from 4.8.4 to 5.0.4 of Typescript and Parse types is written using "typeScriptVersion": "4.5". Not too sure if that can be the problem since I am not a expert on that.

@Jakub-Plan-d-k
Copy link

@andresteves neither am I, but could be. There was something about react native types in the migration guide.
Also I made a small mistake it was RN 0.72.6, I have just checked my repo.
Anyway, you have a quick fix for local builds above, and hopefully this will get fixed soon, so we can use that also in external tools.

@andresteves
Copy link

Can confirm that downgrading typescript to "typescript": "^4.8.4" works with latest Parse 4.2.0 and also RN 0.73.4.

@Jakub-Plan-d-k
Copy link

upgrading to 5.1.0 seem to solve the issue. Thanks a lot guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants