Switch.framerfx
Switch.framerfx copied to clipboard
There is an error with switch components every time when I load the file again
Hello. Every time when I load the file a red box appears stating that there is an error is Switch.tsx, although if I switch the order of the states, and than switch it back again the issue is resolved. It is a bit annoying nevertheless because I need to go trough all my prototype components and switch them one by one. Is there a way to prevent this issue from happening?
Could you provide a file that reproduces the issues, or at least a screenshot of your browser's dev console when the error appears? There isn't enough for me to go on just from this screenshot, unfortunately.
Sure thing. here I am sending few screenshots about the console. the red error "Error: Frame exceeded time limit of 500ms by 1030ms." is repeating a dozen times between the last picture and the one before that.
got the same issue. any progress on that?
I've written about this issue before:
Framer has a "budget" for loading and rendering all code components in a project. The budget is shared across all components in your project (both your own and those from packages), so if any of them loads or renders a little bit slowly and blows through the budget, all other components will show the "exceeded time limit" message.
It’s important to note that Switch is a container component, and when placed on the canvas, all it does is re-render the Frame you’ve pointed it to. If there’s anything in that Frame that renders slowly, then the whole Switch component will exceed its time limit, even though it technically didn’t contribute to the “slowness”.
I know this can be incredibly frustrating, but unfortunately there's not much that can be done other than ensuring that components load and render as fast as possible. I'd recommend:
- Clean up unused packages
- Take a look at your own components and check if they're calling functions at the root level of the component, instead of just exporting components. If they're calling functions, see if you can make them work without the function calls
- See if you’re doing any particularly expensive work when rendering your components
@Robertcsollei, @thisissebastian would you be able to send me your files at [email protected]? This way I can take a closer look at what's actually causing the slowness.
cool, thanks for that! makes sense and is probably the issue since our project is rather huge. unfortunately I am not able to share it though.