You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A simple tight-loop of 300,000 in the REPL causes a message from Svelte: "Infinite loop detected"
Logs
Not much in the logs (what is, is pasted below). Svelte shows a pink banner at the bottom of the page with a message "( ! ) Infinite loop detected"
Logs:
Console was cleared
bundler.js:25 running Svelte compiler version 3.15.0
To Reproduce
Simple use the Svelte REPL and paste the following into App.svelte
<script>
for (let i = 0; i <300000;i++){}letname='The Avett Brothers!';</script><h1>Hello {name}!</h1>
If that's not possible, we recommend creating a small repo that illustrates the problem.
Reproductions should be small, self-contained, correct examples – http://sscce.org.
Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.
Expected behavior
Expect a tight-loop of 300000 to run to completion.
Stacktraces
If you have a stack trace to include, we recommend putting inside a <details> block for the sake of the thread's readability:
Stack trace
Stack trace goes here...
Information about your Svelte project:
-Chrome 78
Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
Windows 10
Svelte version (Please check you can reproduce the issue with the latest release!)
Whatever the REPL is using
Whether your project uses Webpack or Rollup
N/A
Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?
Pretty annoying for me b/c I'm trying to experiment with something that involves an array of about 300,000 elements.
Note: the more honest and specific you are here the more we will take you seriously.
Additional context
Add any other context about the problem here.
I think it's fairly clear from the repo -- nothing else interesting to report.
The text was updated successfully, but these errors were encountered:
This was recently changed as a way to address sveltejs/svelte-repl#40 - Maybe we could bump up the timeout before it bails (it's 100ms right now), but I doubt there's going to be any timeout that achieves the stated goal of avoiding unpleasant accidental hangs that won't have someone who says they need a synchronous blocking loop longer than that.
I'd argue that if you're doing something this intensive, you should probably take this out of the REPL and run your project locally, as you probably don't want to be recompiling your app on every keystroke in the editor anyway.
Thanks for the info. I can take it out of the REPL if that's the recommendation. I just hadn't realized that it would bomb out for this. If I run a tight loop in Chrome, it looks like it should take only about 2ms:
console.time('t');
for (let i = 0; i < 300000; i++)
{
}
console.timeEnd('t');
VM168:5 t: 2.0771484375ms
So I still have to wonder what's going on that 100ms isn't enough?
Each iteration, the browser is now comparing Date.now() with the initial Date.now() when the loop was started and seeing whether 100ms has elapsed - which isn't much, but is a lot more than what is happening in your initial loop, which was nothing.
Describe the bug
A simple tight-loop of 300,000 in the REPL causes a message from Svelte: "Infinite loop detected"
Logs
Not much in the logs (what is, is pasted below). Svelte shows a pink banner at the bottom of the page with a message "( ! ) Infinite loop detected"
Logs:
Console was cleared
bundler.js:25 running Svelte compiler version 3.15.0
To Reproduce
Simple use the Svelte REPL and paste the following into App.svelte
If you can demonstrate the bug using https://svelte.dev/repl, please do.
Repo URL: https://svelte.dev/repl/77691328d3314241839cb7a289c0ac27?version=3.15.0
If that's not possible, we recommend creating a small repo that illustrates the problem.
Reproductions should be small, self-contained, correct examples – http://sscce.org.
Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.
Expected behavior
Expect a tight-loop of 300000 to run to completion.
Stacktraces
If you have a stack trace to include, we recommend putting inside a
<details>
block for the sake of the thread's readability:Stack trace
Stack trace goes here...
Information about your Svelte project:
-Chrome 78
Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
Windows 10
Svelte version (Please check you can reproduce the issue with the latest release!)
Whatever the REPL is using
Whether your project uses Webpack or Rollup
N/A
Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?
Pretty annoying for me b/c I'm trying to experiment with something that involves an array of about 300,000 elements.
Note: the more honest and specific you are here the more we will take you seriously.
Additional context
Add any other context about the problem here.
I think it's fairly clear from the repo -- nothing else interesting to report.
The text was updated successfully, but these errors were encountered: