Glitch editor feezes with project to reproduce

I’ve found a way to reproduce the glitch editor crashing.

in the above project my .eslintrc.json is

{
  "env": {
    "es2021": true
  },

  "rules": {
    "no-useless-escape": "error"
  }
}

and my single js file is

`\n`

interacting with this js file will cause the browser to crash.

here is a gif of me reproducing this in FireFox but I also had the issue in chrome and LibreWolf. The gif pauses for 5 - 10 seconds before the browser warning pops at the top.
giphy

2 Likes

Neat. Time to find out where it’s getting stuck.

1 Like

Turns out this is caused by the eslint-for-the-browser library we’re using having a nifty bug that allows it to go into an infinite, but not infinitely recursive, loop. Changing the config to not use the useless-escapes rule “fixes” it, so I’ve filed an internal ticket to look at updating that lib to a more modern one that doesn’t soft lock the browser although I can’t make any guarantees on when we can get that fixed and pushed out.

1 Like

yes, I have also just decided to remove that rule. I hope this post helps those in the future.

1 Like