Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is an error with switch components every time when I load the file again #14

Open
Robertcsollei opened this issue Oct 30, 2020 · 5 comments

Comments

@Robertcsollei
Copy link

Robertcsollei commented Oct 30, 2020

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?
ntIwBiXUbH

@tisho
Copy link
Owner

tisho commented Oct 31, 2020

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.

@Robertcsollei
Copy link
Author

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.
DOsoo4DH9o
firefox_lGNx4Bu4h9
firefox_VKdQotWuWj
firefox_V3s9Mx9cLD

@thisissebastian
Copy link

got the same issue. any progress on that?

@tisho
Copy link
Owner

tisho commented Nov 13, 2020

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:

  1. Clean up unused packages
  2. 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
  3. 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.

@thisissebastian
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants