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.

Vega-Lite 3.4.0 compile function causes Uncaught RangeError: Maximum call stack size exceeded

See original GitHub issue

I 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"
      }
    }
  }
}
Screen Shot 2019-11-19 at 12 48 00 PM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
domoritzcommented, Nov 20, 2019

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.

0reactions
cassandraoconnellcommented, Dec 3, 2019

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 to Array.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.

Read more comments on GitHub >

github_iconTop 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 >

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