Error: Minified React error #301

I am suddenly getting an error message for an application I built a few months ago which didn't have any issues until last week. My application fails to render every time I use my search box to search for text and hide elements across a ListView:

Error: Minified React error #301 visit Minified React error #301 – React for the full message or use the non-minified dev environment for full...
Screenshot 2024-11-19 at 16.14.54

There's a reload button but this doesn't help either. This started happening about a week ago and has not resolved itself.

From the react page: Minified React error #301 – React

Too many re-renders. React limits the number of renders to prevent an infinite loop.

Do you have any advice for how to resolve this?

Thank you,
Cason

1 Like

+1 on this error

Mine is occurring inside a textbox on a modal that displays a response message from a query

1 Like

Hi all! Welcome to the community, @cason, and welcome back, @haydengreer. :slightly_smiling_face:

This particular error is generally indicative of a circular dependency in the app, which will be difficult to diagnose without a clearer understand of how it's constructed. In testing, for example, I'm unable to replicate this error when recreating the setup that you've described. Can either or both of you share a JSON export of your app with hard-coded query results?

Feel free to share via DM, if necessary!

Hi Darren!
Thank you for your reply. Sorry I am new to the platform how can I DM you my JSON export? I also tried to upload my json export to this response but I got "Sorry new members cannot upload attachments"

No worries! If you click on my name or profile pic, there should be an option to Message me directly.

Hey Darren,

Sorry I'm not seeing an option to Message you directly. Can I send you my file via email?

Ah that must be a restricted feature for newer forum accounts. I was able to get your app JSON via the report that you made on Retool University! I'll take a look and get back to you shortly with next steps. :+1:

1 Like

Hi @Darren,

Any luck finding the issue?

Hey @cason! I don't yet know the exact cause of the issue, but we're able to consistently reproduce the behavior and are hitting a clear error boundary. We'll investigate and prioritize a fix in the coming weeks and provide an update here as soon as we can.

@Darren Awesome, thank you!

1 Like

Any update on this as I am getting this error as well.

1 Like

Hey @Layth! I just responded to your original topic, but will reiterate here that it would be super helpful to get an export of your app that includes hardcoded query results.

I'm mostly interested in knowing how the data source of the List View component is configured. Is it a static set of data or is it being dynamically filtered somehow?

Hi all - I'm happy to report that this should no longer be an issue as of Cloud version 3.159. The fix is being rolled into the stable release of 3.148, as well. Don't hesitate to reach out if you have any questions or notice any similar behavior!

Thanks @Darren, It looks like I'm running on * Retool version 3.174.0
But I'm currently still seeing the issue. Was the fix already released?

Interesting - thanks for the update. The fix should have gone live already, but I just confirmed that there's still something going on. :thinking: It seems to be less frequent, but that could be my imagination.

Is there a particular search term that seems to throw errors more frequently? I ask because it looks like there may have been an incomplete element in the sample data set that you shared previously - the one with an id of 13272, in particular, was missing a location. Removing it from the source seemingly eliminated the error in my testing app.

I'll do some additional looking, regardless, but maybe double check your data to see if that makes a difference!

Thanks @Darren I can consistently replicate the error with the search term "bar". An item not having a location is a feature and expected although this will be the minority of samples.

Out of curiosity, how many results does that particular search term produce? In my own testing, it feels like I only see this error when there's a single result. :thinking:

It the live version of the app there are 0 results for "bar". I tried with "tar" as well and that consistently also produces the error with 2 search results.

All right @cason, I think we've finally identified the root cause of this issue - it looks like dynamically setting the hidden property on an instance causes the virtualizer to get into a render loop. We have a fix planned, but there's actually a way we can refactor your app to avoid this problem and simultaneously improve its performance.

Instead of passing the entire dataset into the List View, create a new transformer that filters out any hidden elements and set it as the new data source. Let me know if you have any questions about implementing this!

Hi @Darren, thanks for the update. Looking forward to the release, any estimated timeline? In the meantime I will look into your proposed solution. It sounds like I need a transformer to make a copy of the full List View data set filtered according to the UI and then pass the copy as the new List View source? Thanks