Environment information
Details
CLI:
Version: 2.5.8
Color support: false
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_DISTRIBUTION: npm
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_LOG_LEVEL: unset
BIOME_LOG_KIND: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
BIOME_WATCHER_KIND: unset
BIOME_WATCHER_POLLING_INTERVAL: unset
NO_COLOR: 1
TERM: dumb
JS_RUNTIME_VERSION: v24.18.0
JS_RUNTIME_NAME: node
NODE_PACKAGE_MANAGER: unset
Biome Configuration:
Status: Loaded successfully.
Path: <project>/biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: true
HTML full support enabled: unset
Workspace:
Open Documents: 0
What happened?
This is a regression in Biome 2.5.8.
Running biome check on an HTML file that contains invalid inline CSS in a style attribute causes an internal panic instead of a parser diagnostic.
The issue was initially discovered in <svg> elements, but it is not SVG-specific: an ordinary HTML <div> reproduces the same panic.
Playground reproduction (open the Console pane): https://biomejs.dev/playground/?tab=formatter&pane=Console&files.main.html=PABkAGkAdgAgAHMAdAB5AGwAZQA9ACIAOQBmAGkAbABsAC0AbwBwAGEAYwBpAHQAeQA6ADEAOwAiAD4APAAvAGQAaQB2AD4A&files.main.tsx=
Minimal input:
<div style="9fill-opacity:1;"></div>
Steps to reproduce:
- Save the snippet as
repro.html.
- Run
npx @biomejs/biome check repro.html.
- Biome panics with:
Source Location: crates/biome_rowan/src/ast/mod.rs:207:13
Message: Tried to cast node with kind CSS_BOGUS as `"biome_css_syntax::generated::nodes::AnyCssRoot"` but was unable to cast
A second invalid inline CSS declaration produces the same panic:
<div style="color(display-p3 0.4549 0.8745 0.5451);fill-opacity:1;"></div>
The HTML is valid, but the CSS declarations embedded in the style attributes are invalid. In the Playground, the Console contains the same panic while the Diagnostics pane reports No diagnostics present and the Biome output is empty.
Expected result
Biome should report a normal diagnostic for invalid CSS embedded in an HTML style attribute and must not panic. Processing should continue for other files.
Code of Conduct
Environment information
Details
What happened?
This is a regression in Biome 2.5.8.
Running
biome checkon an HTML file that contains invalid inline CSS in astyleattribute causes an internal panic instead of a parser diagnostic.The issue was initially discovered in
<svg>elements, but it is not SVG-specific: an ordinary HTML<div>reproduces the same panic.Playground reproduction (open the Console pane): https://biomejs.dev/playground/?tab=formatter&pane=Console&files.main.html=PABkAGkAdgAgAHMAdAB5AGwAZQA9ACIAOQBmAGkAbABsAC0AbwBwAGEAYwBpAHQAeQA6ADEAOwAiAD4APAAvAGQAaQB2AD4A&files.main.tsx=
Minimal input:
Steps to reproduce:
repro.html.npx @biomejs/biome check repro.html.A second invalid inline CSS declaration produces the same panic:
The HTML is valid, but the CSS declarations embedded in the
styleattributes are invalid. In the Playground, the Console contains the same panic while the Diagnostics pane reportsNo diagnostics presentand the Biome output is empty.Expected result
Biome should report a normal diagnostic for invalid CSS embedded in an HTML
styleattribute and must not panic. Processing should continue for other files.Code of Conduct