#2659 brought something to light for me: internal error reporting is uninformative for users and doesn't help them to understand the source of the issue or how to find a workaround.
Biome is a toolchain, a bug can come from any tool, and it is hard to tell without investment of the user.
It would be nice if we could specify which tool caused the error, and even in what unit of work (e.g. a rule for the linter), and the linted/formatted node - if any - (the queried node in the case of the linter).
Taking #2659 as an example.
Here is the current error:
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_semantic/src/semantic_model/scope.rs:115:33
Thread Name: biome::worker_0
Message: no entry found for key
types.ts internalError/panic INTERNAL βββββββββββββββββββββββββββββββββββββββββββββ
β processing panicked: no entry found for key
β This diagnostic was derived from an internal Biome error.
Potential bug, please report it if necessary.
And here is an example of a better diagnostic:
types.ts internalError/panic INTERNAL βββββββββββββββββββββββββββββββββββββββββββββ
β Biome encountered an internal error while linting the file with the
rule suspicious/noRedeclare on the following code
1 β
> 2 β type Element<T> = T extends Array<infer U> ? U : never
3 β
βΉ This diagnostic was derived from the following internal Biome error:
Source Location: crates/biome_js_semantic/src/semantic_model/scope.rs:115:33
Thread Name: biome::worker_0
Message: no entry found for key
βΉ 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/
βΉ As a workaround try to disable the lint rule suspicious/noRedeclare
or ignoring the file `types.ts`.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too