Retool Crashes after loading query displaying stack trace

Typically, when I write incorrect Javascript into a Retool, it is able to run the rest of the app. However, in this case, I'm encountering a bug which causes my entire app to crash in some cases, which is making debugging difficult. The crash happens after a query runs for some amount of time, and I have no idea how to fix it. I cannot find my own call to .substring(), which shows up in the stack trace.

Here's a screenshot an the entire contents of the trace:

TypeError: Cannot read properties of undefined (reading 'substring')
    at l.render (
    at Ja (
    at $a (
    at tu (
    at Bu (
    at Uu (
    at Fu (
    at Iu (
    at t.unstable_runWithPriority (
    at Zo (
    at $o (
    at Yo (
    at Du (
    at Object.notify (
    at t.notifyNestedSubs (
    at t.handleChangeWrapper (
    at g (
    at b (
    at Generator._invoke (
    at forEach.e.<computed> [as next] (
    at b (
    at t (
    at new Promise (<anonymous>)
    at new t (
    at o (
    at T._invoke (
    at forEach.e.<computed> [as next] (
    at p.async (
    at Object.dispatch (
    at s (
    at E (
    at Object.commitModelOperations (
    at e.value (
    at p.handleMessageEventWithData (
    at messageListener (

Hey @Webster_Wing!

Does this happen particularly when the query finishes or as it's running? It might be helpful to see a screenshot of the query itself along with any components it updates or queries that run in parallel with it :thinking:

Here's a screenshot of the query which causes the app to crash after it finishes:

The query is referenced by a chart component:

Here's a picture of the chart in question:

And the "inspect" section in the sidebar:

The puzzling thing is that there is a selector at the top of the tool with all of our campaigns in it, and there's only one option, which upon selecting, causes the app to crash. Very strange bug

It might be worth disconnecting the query from the chart and then inspecting the data that comes back from that particular option. Some questions to ask might be:

  • Can you hardcode the data into the chart and have it function?
  • Does only passing dataset1 or dataset2 work?
  • If you create a new chart and pass the data in does it behave properly?

I don't see any obvious cause here either so taking a more general approach of sectioning things off and narrowing down what's causing the problem is the way I'd go here!

Turns out, when I was referencing in the label section, I had mis-spelled the key. Changing it to prevents the app from crashing, but I am still confused as to why it crashed in the first place.

Glad you were able to find the issue! Do you know when this chart was first created? From the screenshots you posted it looks like you may be using a deprecated version of the component.