question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maximum call stack size exceeded

See original GitHub issue

I have to use the null as value in mutations. Therefore I cloned the repository and packaged it.

Now in parse.js line 488 in the function parseValueLiteral accepts null as value. But when I use it in the browser i get the error:

RangeError: Maximum call stack size exceeded
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:77:19)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)
    at stripLoc (https://localhost:9000/lib/graphql-tag/browser.js:105:26)

To use Graphql-tag in the browser I used browserify (browserify index.js --standalone graphqlTag -o=browser.js).

In my file line 77 is:function stripLoc (doc, removeLocAtThisLevel) {.

Line 105 is

if (valueType === '[object Object]' || valueType === '[object Array]') {
     doc[keys[key]] = stripLoc(value, true);
}

in function stripLoc.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KordonDevcommented, Feb 1, 2017

Further investigation got me to the point that I noticed that with the now graphql version, the property loc has to new properties startToken and endToken. Both are of the type Tok. Tok has the properties next and previous which point to another Tok with these two properties. This is the point where the infinite loop appears.

My workaround is to store the properties startToken and endToken in local variables and attach it after the for loop again.

I will make an pull request where you can see the problem.

Now I get the error in apollo-client, I will look for that later.

0reactions
jnwngcommented, Feb 28, 2017

this should be resolved as part of graphql-tag@v1.3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
Maximum call stack size exceeded error ... This error is almost always means you have a problem with recursion in JavaScript code, as...
Read more >
RangeError: Maximum call stack size exceeded in JavaScript
The "RangeError: Maximum call stack size exceeded" error occurs when a function is called so many times that the invocations exceed the call...
Read more >
Maximum Call Stack Size Exceeded (Typescript Error) - Medium
Scenario for Maximum Call Stack Size Exceeded Error ... In your code, the possibility is, You are calling a function that is calling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found