gaearon / gaearon/react-hot-loader

React hot loader leaking?

Open
#1,180 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
775
PR merge metrics
No merged PRs in 30d

Description

If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.

### Description

What you are reporting:

Seems like there's a leak in the hot loader? For each instance of my `Annotator` component, I see a retainer hierarchy like the following in the Heap snapshot I took in the Memory tab:

screen shot 2019-02-13 at 7 35 17 pm

### Expected behavior

What you think should happen:

I think that the `gui` you see at the top of the retainer hierarchy should be garbage collected, and my component is done with it, but it is leaking. I see lots of React stuff in the retainer stack.

### Actual behavior

What actually happens:

The yellow-highlighted objects in the stack are the only things that JS has references to, which looks to be the `enter()` function, which seems related to React hot loader.

### Environment

React Hot Loader version: `4.6.5`

Run these commands in the project folder and fill in their results:

1. `node -v`: `v8.11.3`
2. `npm -v`: `6.5.0`

Then, specify:

1. Operating system: macOS
2. Browser and version:

```json
{
"node":"10.2.0",
"v8":"6.6.346.32",
"electron":"3.0.9",
"chrome":"66.0.3359.181"
}
```

### Reproducible Demo

No simple reproduction yet.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.