pusher / pusher/pusher-websocket-react-native

ERROR TypeError: Cannot read property 'getInstance' of undefined, js engine: hermes

Open
#162 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
76
Forks
64
PR merge metrics
No merged PRs in 30d

Description

i was referring the pusher official doc and implemented as it was given. I wanted to implement the chat feature for the react native expo app.When i used this code I got the error.

const pusher = Pusher.getInstance();

await pusher.init({
apiKey: API_KEY,
cluster: API_CLUSTER
});

await pusher.connect();

ERROR TypeError: Cannot read property 'getInstance' of undefined, 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

if i remove that code everything works fine

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking how Pusher is imported in the React Native Expo app and whether the imported value exposes getInstance(). Reproduce the Hermes error with the shown initialization code, then confirm the app can register its main component when that code is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.