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

RangeError: Maximum call stack size exceeded #168

Closed
odeal4ik opened this issue Dec 23, 2020 · 24 comments
Closed

RangeError: Maximum call stack size exceeded #168

odeal4ik opened this issue Dec 23, 2020 · 24 comments
Labels
bug Something isn't working

Comments

@odeal4ik
Copy link

odeal4ik commented Dec 23, 2020

Hello, i implemented your thing to my project
And it goes fine.

"@babel/preset-react": "^7.9.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"@welldone-software/why-did-you-render": "^6.0.3",

When i use it with [hrm], after some changes in files with code, it reloads fine.
But, if i press f5, for example, my app crashes with error RangeError: Maximum call stack size exceeded...

RangeError: Maximum call stack size exceeded at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:236:22) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.apply (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40) at Object.React.createElement (C:\Develop\auchan-ecom-food-front\.yarn\$$virtual\@welldone-software-why-did-you-render-virtual-0f42de02d0\0\cache\@welldone-software-why-did-you-render-npm-6.0.3-f9d43ade3b-2.zip\node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js:257:40)

here is config and import
image
image

i can't understand what to do.
if needed some more info, pls report

@odeal4ik
Copy link
Author

Upd. tried to watch one component by option include , and got the same thing.

@vzaidman
Copy link
Collaborator

thanks ill look at it soon

@vzaidman vzaidman added the bug Something isn't working label Dec 23, 2020
@vzaidman
Copy link
Collaborator

vzaidman commented Dec 23, 2020

@odeal4ik
can you please check what is on line 257 of:
node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js
and also line 236

also, there is actually no "src" in node_modules\@welldone-software\why-did-you-render what kind of system do you use that it exists there?

@vzaidman
Copy link
Collaborator

also, what webpack / create-react-app do you use?

@odeal4ik
Copy link
Author

@odeal4ik
can you please check what is on line 257 of:
node_modules\@welldone-software\why-did-you-render\src\whyDidYouRender.js
and also line 236

also, there is actually no "src" in node_modules\@welldone-software\why-did-you-render what kind of system do you use that it exists there?

I thought this is it ?!...
image

win10

@odeal4ik
Copy link
Author

odeal4ik commented Dec 23, 2020

also, what webpack / create-react-app do you use?

image

not create app
i can give full list of dependencies if it needed

@vzaidman
Copy link
Collaborator

how did you install the package?

npm install @welldone-software/why-did-you-render

?
because it has no src. only dist

@vzaidman
Copy link
Collaborator

vzaidman commented Dec 24, 2020

also-
can you try adding this at the bottom of the wdyr file?

if (process.env.NODE_ENV === 'development') {
  if (module.hot) {
    module.hot.decline();
  }
}

@odeal4ik
Copy link
Author

odeal4ik commented Dec 24, 2020

how did you install the package?

by yarn add @welldone-software/why-did-you-render

@vzaidman
Copy link
Collaborator

vzaidman commented Dec 24, 2020

try clearing cache and reinstall

yarn cache clean

and

yarn install --force

@odeal4ik
Copy link
Author

i use
rm -rf .yarn/cache
rm -rf yarn.lock

then yarn install my dependencies, but now i have some problem with start my app, it lil crashes.

if (process.env.NODE_ENV === 'development') { if (module.hot) { module.hot.decline(); } }
you just want to "disable" hot in this mode?

@vzaidman
Copy link
Collaborator

only on the wdyr file

@odeal4ik
Copy link
Author

for proof it module, and module.hot in wdyr.ts file, and problem is the same, it still crashes after page reload
image

image

@vzaidman
Copy link
Collaborator

are you using Yarn 2?

@odeal4ik
Copy link
Author

odeal4ik commented Dec 24, 2020

oh yeah, i forgot to notice that

@vzaidman
Copy link
Collaborator

Maybe try yarn 1? I dont know how it works

@odeal4ik
Copy link
Author

oh, too many things were made for using yarn 2...i'll try on this project somehow to change on v1, but it seems to me, that i'll see more bugs with this.

@odeal4ik
Copy link
Author

i tried on cra with yarn 1 and hot reload, and all goes fine (

@vzaidman
Copy link
Collaborator

i think it has to do with yarn2 cache. it looks bugged to me because there's no

@welldone-software\why-did-you-render\src

only

@welldone-software\why-did-you-render\dist

I'm glad it works!

@odeal4ik
Copy link
Author

Ok, i think it's a yarn problem, but, i patch my yarn config, and duplicate dependencies in node_modules, and they are there, it 100%.
image

But error still exist
image

And why it links to sourse libs files? Not to modules?
image

@davidgilbertson
Copy link

I'm getting the same issue. I don't use yarn. Nothing happens on a few pages, then one page does this:

 RangeError: Maximum call stack size exceeded
[0]     at getWDYRType (C:\Users\david\web\keplar\node_modules\@welldone-software\why-did-you-render\dist\whyDidYouRender.js:1418:25)
[0]     at Object.React.createElement (C:\Users\david\web\keplar\node_modules\@welldone-software\why-did-you-render\dist\whyDidYouRender.js:1444:22)
[0]     at Object.React.createElement (C:\Users\david\web\keplar\node_modules\@welldone-software\why-did-you-render\dist\whyDidYouRender.js:1471:42)
[0]     at Object.React.createElement (C:\Users\david\web\keplar\node_modules\@welldone-software\why-did-you-render\dist\whyDidYouRender.js:1471:42)
[0]     at Object.React.createElement (C:\Users\david\web\keplar\node_modules\@welldone-software\why-did-you-render\dist\whyDidYouRender.js:1471:42)
[0]     at Object.React.createElement (C:\Users\david\web\keplar\node_modules\@welldone-software\why-did-you-render\dist\whyDidYouRender.js:1471:42)

I'm using Next.js which will be doing some server-rendering.

Setup is a copy/paste from the readme (I'm using TypeScript):

/// <reference types="@welldone-software/why-did-you-render" />
import React from 'react';

if (process.env.NODE_ENV === 'development') {
  const whyDidYouRender = require('@welldone-software/why-did-you-render');
  whyDidYouRender(React, {
    trackAllPureComponents: true,
  });
  // Tried with and without this:
  if (module.hot) {
    module.hot.decline();
  }
}

Node: 14.14.0
npm: 6.14.0

Some other versions, not sure what might be relevant

    "@welldone-software/why-did-you-render": "^6.0.4",
    "next": "^9.5.5",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "typescript": "^4.1.3",

@vzaidman
Copy link
Collaborator

@davidgilbertson what version of Next.js / React?

@vzaidman vzaidman reopened this Dec 30, 2020
@vzaidman
Copy link
Collaborator

vzaidman commented Dec 30, 2020

ok! I've managed to reproduce the bug in next.js and fixed it in version @ 6.0.5!

@davidgilbertson
Copy link

You work fast! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants