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

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'subscriptionFailedCallback') #684

Open
divsbhalala opened this issue Oct 8, 2021 · 18 comments

Comments

@divsbhalala
Copy link

I implement the subscription in my app and subscription working fine but in sentry and console I am seeing this error

@cefeboru
Copy link

@divsbhalala were you able to find what was causing this issue? We are having a lot of reports in sentry as well

@AndrzejSala
Copy link

We have the same issue.
It can be triggered by network error and then there are errors like this on reconnect / refetch.

@AndrzejSala
Copy link

@divsbhalala
Could you share your package.json?

@jacobgranberry
Copy link

Same happening here, been happening for months.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'subscriptionFailedCallback')
    at AppSyncRealTimeSubscriptionHandshakeLink.<anonymous> (realtime-subscription-handshake-link.js:325:1)
    at step (realtime-subscription-handshake-link.js:57:1)
    at Object.next (realtime-subscription-handshake-link.js:38:1)
    at fulfilled (realtime-subscription-handshake-link.js:29:1)
    ```

@arbaaz
Copy link

arbaaz commented Mar 15, 2022

Same here.

@arbaaz
Copy link

arbaaz commented May 9, 2022

Any updates on this?

@ryancrunchi
Copy link

Duplicate of #509

@heanfig
Copy link

heanfig commented Jul 16, 2023

Any updates ?

    "@apollo/client": "^3.5.10",
    "aws-appsync-subscription-link": "^3.1.2",

@shawngustaw
Copy link
Contributor

Anyone have any ideas? I'm hitting this using Next with strict mode turned off. I managed to temporarily work around this by delaying setting up the subscription using a setTimeout(() => {enableSubscriptions(true)}, 0) on mount, but don't know how stable this is.

@shawngustaw
Copy link
Contributor

@heanfig could you test/verify this PR to fix this? #747. To build I had to add types: [] to the tsconfig.json but then you can run yarn prepare && yarn pack and then yarn add ../path/to/package.tar.gz the file that gets created from yarn pack.

@omerson
Copy link

omerson commented Oct 23, 2023

in my case skip: !idToSubscribeOn solved the problem

@objectiveSee
Copy link

@omerson can you elaborate on how this fixed your problem? Do you have a code example? I am facing the same issue today.

@shawngustaw
Copy link
Contributor

@omerson can you elaborate on how this fixed your problem? Do you have a code example? I am facing the same issue today.

I believe this happens specifically during navigation in nextJS so just delaying setting up the subscription until after the page renders seems to work. I have a PR that fixes this that we've been running in prod as a patch (using patch-package) for a couple days without issue and I haven't seen this pop up again. Trying to get someone from AWS to review but it seems like this package is abandoned.

@shamseer-ahammed
Copy link

shamseer-ahammed commented Dec 4, 2023

+1

@shawngustaw did u fix it ?

@shawngustaw
Copy link
Contributor

@shamseer-ahammed yes using a patch with this PR:

#747

@gong917727564
Copy link

Any updates on this?

@ivadenis
Copy link

ivadenis commented Mar 1, 2024

facing the same issue in nextjs app

@shamseer-ahammed
Copy link

@gong917727564 @ivadenis tried with aws-appsync-subscription-link@3.1.3 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests