Endless number of awaits with 100% CPU usage on first load of Routify app
See original GitHub issueWhen I first open my app on a new domain (or in an incognito tab), the browser tab freezes with 100% CPU usage. If I force close the tab and open it again, everything works as normal: very strange.
If I pause execution while this is happening, it looks like there is some sort of infinite number of waiting promises, or infinite recursion happening. Here is what the call stack looks like:

And here are the relevant functions that are getting called repeatedly. First, pushstate:

then updatePage:

and finally preload():

version Routify 2.12.7 with Svelte 3.32.1.
Again, this only happens on the first load, not subsequent ones.
@jakobrosenberg: happy to add this to our next live debugging session 😁
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
CPU Usage Stuck between 80%-100% without any apps ...
I need help 5 hours ago, my laptop suddenly had it's cpu utilization/usage ramped up to 80%-100% and throttling the temperature to 93°...
Read more >You may be massively overpaying for your CPUs
First, if your application has inelastic performance (has high CPU hangs when the CPU usage goes to moderate or high), you may be...
Read more >SW is reporting servers memory/cpu always hits 100 ...
Is this normal? It's not a consistent 100% utilization. It more so seems like I get hammered with alerts at least 1 once...
Read more >Infinite Loops Are Chewing up Your CPU!
An infinite loop causes unexpected consumption of resources, such as CPU or memory. It could take CPU usage to near 100% and hinder...
Read more >Why I wouldn't recommend Svelte JS to a fellow CTO
Yes you can get svelte and sveltekit to build jamstack-compatible apps but I've done it and it takes too many workarounds.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This should hopefully be fixed now. Thanks for the help on this one @mizzao and @lamualfa.
Thanks for the repro @lamualfa . I’m trying to crack this one.