Free Code Camp Infinite Loop Protection

Free Code Camp Infinite Loop Protection


The Free Code Camp code runner has a built in Infinite Loop Protect feature, leveraged from JSBin’s Loop Protect. The loop protect injects some code into user created loops to allow a safe exit if more than ~500ms has passed without exiting the loop. Loop protect will catch many, but not all infinite loop issues. If you see this message:

Error: Potential infinite loop at line X

It means you have been protected from an infinite loop.

Note: Loop Protect cannot detect infinite recursion.

Disable Loop Protect

In some cases - a slow computer or a long loop - you may get an incorrect loop protect. In order to disable loop protect, add the following comment over the line the loop protection message lists:


Warning: Disabling loop protect means you may potentially allow your code to go into an infinite loop, causing your browser to be unresponsive.

Recovering Unresponsive Code

If you have erred and incorrectly disabled loop protection and now have an unresponsive solution, you can disable Code Auto-Run.

By default, the Free Code Camp site automatically loads and runs your last recorded solution. If you have accidentally created an infinite loop or other irrecoverable error or simply don’t trust the code, you can disable code auto-run by putting the following in your URL: run=disabled



No-Run URL:

[Challenge] Sum All Primes - Inifite Loop
Infinite Loop Protection does not work. Browser Crashes
Smallest Common Multiple Potential Infinite Loop for only one Test Case
Chunky Monkey Crashes my Browser [SOLVED]
Smallest Common Multiple Help!
Code won't run after disabling auto run to fix infinite loop
Smallest Common Multiple - Inconsistent results
Page is unresponsive
Smallest common multiple - works in browser, won't pass last freeCodeCamp test [SOLVED]
Need Design Tips
Sum all Fibonacci numbers challenge froze
Freecodecamp showing wrong infinite loop error
Freecodecamp page is not responding
Crush page - "Slash Flick"
Counting Cards Challenge - Stuck in printing loop?
FreeCodeCamp console calculations
Page hangs when opening challange
Cannot pass the last test: Problem 7: 10001st prime
HELP: Problem 4: Largest palindrome product
Sum All Primes Error
Smallest Common Multiple, can't pass the last two tests
Problem with Sum All Primes Intermediate challenge
Page is Frozen on Smallest Common Multiple