question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning about memory leak from state update on an unmounted component causes tests to fail

See original GitHub issue

Hi. I am using the events function to make calls to my API to retrieve events. It all seems to be working but in my tests I am receiving warnings:

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 the componentWillUnmount method.
        in CalendarDataProvider (created by FullCalendar)
        in FullCalendar (at CalendarView.tsx:47)
        ...

This issue is causing my tests to fail intermittently on the pipeline, due to the test taking too long to complete.

I have provided a CSB here (simulating the API call): https://codesandbox.io/s/charming-bas-xzpp3?file=/src/App.tsx

Steps to reproduce:

  1. Run App.test.tsx
  2. See CSB console to view warnings, similar to above.

Any help to solve this issue is appreciated.

Thanks.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
SemperFortiscommented, Apr 29, 2021

Hi @arshaw, I’ve also been running into this issue recently with the Google Calendar plugin. The delay caused by Google’s APIs cannot be changed, which causes memory leaks every time. Hopefully, this will be fixed in the near future or it will not be a viable solution to many due to this small issue.

0reactions
adrienclay36commented, Feb 13, 2022

Nothing on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning about memory leak from state update on an ... - GitHub
Warning : Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in...
Read more >
How does a state update on an unmounted component cause ...
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...
Read more >
Fix “Cannot perform a React state update on an unmounted ...
It happens if one performs a state update (call setState) on a component that has been unmounted. React warns us that this causes...
Read more >
How to fix the React memory leak warning - DEV Community ‍ ‍
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...
Read more >
Can't perform a React state update on an unmounted ... - Reddit
Full warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found