swc-project/swc · error · swc_css_parser::Error
Expected ident (with 'or' value) token
Error message
Expected ident (with 'or' value) token
What it means
Fired while parsing a @supports condition's `or` operand: the parser expected the current token to be the ident `or` (case-insensitive) to build a SupportsOr node, but another token was found. Input at fault is an @supports condition where a conjunction/disjunction keyword is missing or misspelled.
Source
Thrown at crates/swc_css_parser/src/parser/at_rules/mod.rs:1103
condition: supports_in_parens,
})
}
}
impl<I> Parse<SupportsOr> for Parser<I>
where
I: ParserInput,
{
fn parse(&mut self) -> PResult<SupportsOr> {
let span = self.input.cur_span();
let keyword = match cur!(self) {
Token::Ident { value, .. } if value.as_ref().eq_ignore_ascii_case("or") => {
let ident: Ident = self.parse()?;
Some(ident)
}
_ => {
return Err(Error::new(
span,
ErrorKind::Expected("ident (with 'or' value) token"),
));
}
};
self.input.skip_ws();
let supports_in_parens = self.parse()?;
Ok(SupportsOr {
span: span!(self, span.lo),
keyword,
condition: supports_in_parens,
})
}
}
View on GitHub (pinned to 5176682b65)
Solutions
- Use the `or` ident between @supports conditions
- Report the collected error
- Fix the condition syntax
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/swc_css_parser/src/parser/at_rules/mod.rs:1103 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of swc-project/swc@5176682b65 (2026-08-17).
Data as JSON: /api/errors/7f272d2026a491cf.
Report an issue: GitHub.