[Bug] Usage of Head component results in ‘Maximum call stack exceeded’
See original GitHub issueEnvironment
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Memory: 18.74 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.11.3/bin/npm
Browsers:
Chrome: 73.0.3683.103
npmPackages:
react: ^16.8.2 => 16.8.6
react-dom: ^16.8.2 => 16.8.6
react-static: ^7.0.7 => 7.0.7
react-static-plugin-reach-router: ^7.0.0 => 7.0.0
react-static-plugin-scss-modules: ^1.0.3 => 1.0.3
react-static-plugin-sitemap: ^7.0.0 => 7.0.0
react-static-plugin-source-filesystem: ^7.0.0 => 7.0.0
Steps to Reproduce the problem
react-static create --name test --template basic
- Edit
about.js
by adding the following:
// about.js
import React from 'react'
+ import { Head } from 'react-static'
export default () => (
<div>
+ <Head>
+ <title>Test</title>
+ </Head>
<p>React Static is a progressive static site generator for React.</p>
</div>
)
yarn start
- Open the app in the browser
- Click on About in the nav
- The About page is opened, title updated to Test
- Click on About again
- Behold the
RangeError: Maximum call stack size exceeded
Expected Behavior
No error.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
[Bug] Usage of Head component results in 'Maximum call ...
I've got a potential fix for this. React static should just need to bump the version of react-helmet that is being used from...
Read more >Angular 7 error RangeError: Maximum call stack size exceeded
1.This error occur when there is an infinite loop. As you have mentioned that the page loads when app-heroes is commented, this might...
Read more >JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >JavaScript Error: Maximum Call Stack Size Exceeded
When recursive code is missing its base code or shoots past the base code, it will repeatedly keep calling itself until you hit...
Read more >Maximum call stack size exceeded
I am getting the following error while I am trying to display a svg through a meaure. Stack Trace Message: An error occurred...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kirklikecaptain, this issue will be automatically closed once #1175 is merged. But until then, simply running
yarn upgrade
should do the trick.I did some digging and found that this is React Helmet’s issue: https://github.com/nfl/react-helmet/issues/373. Allegedly fixed in v6.0.0-beta, but it hasn’t moved from beta since.
A workaround is to use props instead of children:
Interestingly, following the exact same steps to reproduce with React-Static v6, doesn’t result in this issue. And I didn’t have this issue with v5. So it means that some changes in v7 surfaced it. Will need to keep digging ⛏️