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 #31

Closed
osoese opened this issue Jun 3, 2019 · 8 comments
Closed

RangeError: Maximum call stack size exceeded #31

osoese opened this issue Jun 3, 2019 · 8 comments

Comments

@osoese
Copy link

osoese commented Jun 3, 2019

RangeError: Maximum call stack size exceeded

I have this running for a long time and it hits this limit

@sindresorhus
Copy link
Owner

Can you include the full error message including the error stack? It would also be helpful if you could include some code that reproduces the issue.

@osoese
Copy link
Author

osoese commented Jun 3, 2019

C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:87
set(target, property, value, receiver) {
^

RangeError: Maximum call stack size exceeded
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:87:6)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()
at Object.set (C:\osoese\sapphire-alpha-0.0.1\node_modules\on-change\index.js:93:27)
at Object.set ()

if you want something more than this please let me know how to provide it. Great package by the way, thank you.

@DarrenPaulWright
Copy link
Collaborator

Could you show us what the watched object/array looks like and what you are changing on it that produces the error?

@osoese
Copy link
Author

osoese commented Jun 3, 2019

its pretty complex and I did not look which part cased the error until i happens again. It updates every 2-10 seconds in some aspect of about 30 items, some of which are multiple levels. This takes hours to error, so next time I will try and follow what exactly the update was. Also I have not updated since "on-change": "^1.3.0", if that helps.

@DarrenPaulWright
Copy link
Collaborator

Ah, now the error stack makes more sense. There are a couple changes in 1.4.0 that I think may fix your bug. Perhaps when it errors again and you figure out the change that caused the error, then update to 1.4.0 and see if it happens again?

@osoese
Copy link
Author

osoese commented Jun 11, 2019

update - this did not fix the issue. I think the error is just what it says it is - there is a limit to the number of changes being tracked before the call stack size is exceeded. In this program I am changing an large structure repeatedly thousands of times. I have only started to look into your code and I was unfamiliar with reflect object but I see you use it extensively. Maybe for a solution like mine a simple recall of the on-change initialization every so often (clearing the history) would work. I do not need the history in memory and if it was something I needed I could store it. I was only really interested in the actual monitoring of state for a change.

@DarrenPaulWright
Copy link
Collaborator

Are you using the value or previous value that are provided in the callback? As Sindre said earlier, it would be helpful if you could include some code that reproduces the issue. Even if you have a work around, I still want to figure out whats happening and find a solution. Thanks!

@DarrenPaulWright
Copy link
Collaborator

I'm closing this issue since we haven't heard back from you in a while. If you're still seeing this error we can re-open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants