react-static: [Bug] Out of Memory with basic template
Reporting a bug?
I’ve created a new site from the basic template. After doing a build and serve, opening the site locally creates an Out of memory error. As far as I can see it’s stuck in hydrating.
Commenting out React.Suspense
in App.js fixes the issue.
This also happens when the react(-static) packages are updated to the latest versions.
Environment
react-static cli 7.5.0
System:
OS: Windows 10 10.0.19041
CPU: (24) x64 AMD Ryzen 9 3900 12-Core Processor
Memory: 44.57 GB / 63.90 GB
Binaries:
Node: 12.18.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 88.0.4324.150
Edge: Spartan (44.19041.423.0)
Internet Explorer: 11.0.19041.1
npmPackages:
react: ^16.9.0 => 16.14.0
react-dom: ^16.9.0 => 16.14.0
react-static: ^7.2.0 => 7.5.0
react-static-plugin-reach-router: ^7.2.0 => 7.5.0
react-static-plugin-sitemap: ^7.2.0 => 7.5.0
react-static-plugin-source-filesystem: ^7.2.0 => 7.5.0
Steps to Reproduce the problem
Base your steps off of any freshly installed react-static template! basic template:
- yarn build
- yarn serve
- Open in chrome
- Browser tab crashes after a while
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 21 (12 by maintainers)
Commits related to this issue
- Prevent endless suspense loop closes #1564 — committed to andreme/react-static by andreme 3 years ago
Released as 7.5.3
I tried it out on my machine after releasing and it works. Let me know if it doesn’t for you.
Not sure if this is helpful, but I’m encountering this and getting some odd behavior.
I get the infinite loop leading to crash with both basic and typescript templates. I also discovered that commenting out
React.Suspense
fixes the issue. However, doing that causes the dev server to serve an error on every page.However, if I then edit a file, causing the dev server to reload, the issue goes away and the entire site loads fine. If I restart the dev server, it again errors until I modify a file to cause it to reload.
@TriDotS 's solution of downgrading to
7.4.2
worked for me.It does! Thank you for fixing this issue!
Took me some time but I have a workaround for the basic template to get a prod build
The trick here is to remove the
^
from version^7.5.1
and rollback to7.4.2
you can keep the plugins versions as they areMy working package.json
(Please refrain from “me to” commentary as this bug has been confirmed. Now “all we need” is a solution 😄 )
@andreme just ran into this. If you’re looking for a quick fix, revert to
7.4.2