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

Biome crashes when analysing incomplete comments/regex literals (single /) #458

Closed
1 task done
silversquirl opened this issue Sep 30, 2023 · 2 comments
Closed
1 task done

Comments

@silversquirl
Copy link

silversquirl commented Sep 30, 2023

Environment information

Github won't let me post biome rage because it says the issue body is too long

$ biome version
CLI:        1.2.2
Server:     not connected
$ uname -a
Linux DESKTOP-E310FOD 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Also happens on my laptop running Fedora Silverblue

What happened?

  1. Open a new file with biome LSP enabled
  2. Type /
  3. Biome crashes

Alternatively:

$ echo / >test.js
$ biome check test.js
Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: crates/biome_js_syntax/src/expr_ext.rs:633:26
Thread Name: rome::worker_0
Message: begin <= end (1 <= 0) when slicing `/`

test.js internalError/panic  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ processing panicked: begin <= end (1 <= 0) when slicing `/`
  
  ⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.
  

Checked 1 file(s) in 1106µs

Expected result

Should output a syntax error instead of crashing

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos
Copy link
Member

This should be fixed in #452. The fix will ship in the next release.

@Conaclos
Copy link
Member

As a temporary fix, I recommend disabling noControlCharactersInRegex.

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

2 participants