Vega-Lite 3.4.0 compile function causes Uncaught RangeError: Maximum call stack size exceeded
See original GitHub issueI am using Vega and Vega-Lite inside of React and manually compiling Vega-Lite specs down to Vega. The following spec causes Uncaught RangeError: Maximum call stack size exceeded
when manually passed into the compile()
function. According to the stack trace it looks like something wonky is happening inside of the concat module. I was able to manually pass this same spec (with the $schema
field changed) into Vega-Lite 2’s compile()
function without a problem.
{
"$schema":"https://vega.github.io/schema/vega-lite/v3.json",
"width":630,
"height":290,
"autosize":{
"type":"fit",
"contains":"padding"
},
"config":{
"axis":{
"labelColor":"#888c95",
"titleColor":"#888c95",
"domain":false
},
"legend":{
"labelColor":"#888c95",
"titleColor":"#888c95"
},
"scale":{
"bandPaddingInner":0,
"round":false
},
"view":{
"fill":"#414855",
"stroke":"transparent"
}
},
"data":{
...
},
"mark":"rect",
"encoding":{
"y":{
"field":"time",
"type":"ordinal",
"timeUnit":"day",
"sort":[
"mon",
"tue",
"wed",
"thu",
"fri",
"sat",
"sun"
]
},
"x":{
"field":"time",
"type":"ordinal",
"timeUnit":"hours"
},
"size":{
"field":"value",
"type":"quantitative",
"aggregate":"mean"
},
"color":{
"field":"value",
"aggregate":"mean",
"type":"quantitative",
"scale":{
"scheme":"viridis"
}
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >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 >How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >Uncaught RangeError: Maximum Call Stack Size ... - STechies
The Uncaught RangeError is caused when the browser's hardcoded stack size is exceeded and the memory is exhausted. So, always ensure that the...
Read more >Embedding Vega-Lite
Then use Vega-Embed's provided function to embed your spec. // More argument info at https://github.com/vega/vega-embed vegaEmbed('#vis', yourVlSpec);.
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 FreeTop 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
Top GitHub Comments
Thanks for the context. If we have an infinite loop, I’d want to fix that. Can you keep looking for an example that creates this issue in the editor? I can look into and fix it then.
Okay @domoritz, we figured out what’s going on here. The error was happening because we use Babel to transpile our code, and this line of code was somehow being generated as having a recursive reference to
this
. Interestingly enough, changing the spread operator in that line toArray.from(this)
fixed our problem.We’re going to tell Babel to ignore all of our Vega imports for now, as we’re having some more issues with mixing Babel and Vega/Vega-Lite (which we’re still figuring out). It all seems to revolve around overriding the
Set
prototype though—once that’s figured out, I’ll open a new issue if it is indeed a Vega problem.