Where to find JavaScript expression reference(s) requiring manual deletion when deleting component

I'm trying to delete a component, however I receive a pop-up saying:

[component_id] is referenced in 1 place. Are you sure you want to delete it?
You will need to manually delete the following JavaScript expression reference: [component_id].title

The problem is, this pop-up doesn't say where the reference occurs, only what the reference is.

I did not create this component, and this app has ~80 JS queries and transformers, and hundreds of components. I actually scanned through the JS bodies of the queries/transformers, and even the inputs in the bottom pane that allow JS references, but no luck.

I know I could plow forth and just delete the component and then have a hanging reference that may break something else (hopefully) loudly, but I'd like to avoid that.

Is there no way for Retool to point me to the reference?

1 Like

Hey @dguzzo, welcome to the community :hugs:

I'm running into the same issue from time to time. I'm not aware of any additional referencing other then the Query dependencies graph which you can access with CTRL + ` (backtick).

Give it a try.

2 Likes

Thank you, @minijohn! Both for the warm welcome and the suggestion.

I wasn't aware of that Query dependencies graph! Super cool. Though as you can tell from this zoomed out screenshot, it certainly reflects the size of the app I'm dealing with. :flushed: (Part of what precipitated this is an attempt to break up said app into smaller ones.)

If any Retool folks are reading this, it'd be nice to add that shortcut into the Keyboard shortcuts box!

I was aware of the per-component dependencies in the left pane, which is quite useful normally, just doesn't help my specific case.

Screen Shot 2022-04-19 at 4.51.02 PM

Oh well, for now I think I can at least duplicate the app; remove the component with the reference; and see what if anything breaks, to be extra cautious. Otherwise I can just try to deal with the consequences by performing the deletion in the main app and testing in edit mode or as a draft release.

One last idea: maybe this is Retool's under-the-hood JS for the iframe component not knowing how to handle itself during deletion?

I didn't have Show top bar on when trying to delete the iframe, but just happened to see the option when trying to figure out what was going on. Seems a possibility that the reference in question is the one built in as an adornment option. I'm 99% certain there's no user reference to that .title anywhere I have access to.

Screen Shot 2022-04-19 at 5.09.44 PM

Screen Shot 2022-04-19 at 5.09.55 PM

In this case, I don't think there'd be a hanging reference anywhere in my query code/components, but rather the reference gets deleted after confirming the deletion. /shrugs/