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

gqty tries to update an unmounted component #779

Closed
noverby opened this issue Mar 31, 2022 · 0 comments
Closed

gqty tries to update an unmounted component #779

noverby opened this issue Mar 31, 2022 · 0 comments

Comments

@noverby
Copy link
Contributor

noverby commented Mar 31, 2022

I get the warning Warning: Can't perform a React state update on an unmounted component.
The warning happens when I navigate around my web app, and by that mount and unmount components that uses subscriptions.
After the warning occurs, all subscriptions will not update anymore.

There have been a similar issue in apollo: apollographql/apollo-client#6209

The check in gqty for whether the relevant component is mounted does not seem to work.

Full stack trace:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
PollChartSub@webpack-internal:///./components/poll/PollChartSub.tsx:128:14 next-dev.js:32:25
    error next-dev.js:32
    overrideMethod react_devtools_backend.js:3973
    React 5
    useForceUpdate common.mjs:28
    useDeferDispatch common.mjs:97
    onChange common.mjs:310
    (Async: promise callback)
    unsubscribeCache common.mjs:221
    sendCacheChange index.mjs:9
    scanNormalizedObjects index.mjs:129
    mergeCache dataCache.mjs:23
    onData resolvers.mjs:372
    callback index.mjs:57
    handler client.mjs:253
    handleMessage client.mjs:188
    onmessage client.mjs:66
    (Async: EventHandlerNonNull)
    connect client.mjs:65
    createSubscription client.mjs:238
    execSubscribe index.mjs:63
    subscribe index.mjs:31
    buildAndSubscribeSelections resolvers.mjs:445
    resolveSelections resolvers.mjs:541
    resolveSchedulerSelections client.mjs:61
    fetchSelections index.mjs:111
    execFetch debounce.mjs:6
    (Async: setTimeout handler)
    debounced debounce.mjs:14
    addSelectionToScheduler index.mjs:162
    addSelection index.mjs:13
    addSelection index.mjs:51
    resolve index.mjs:338
    get index.mjs:376
    parseData PollChart.tsx:38
    PollChart PollChart.tsx:63
    React 9
    unstable_runWithPriority scheduler.development.js:468
    React 2
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

1 participant