Skip to content

Turbopack fails on CSS pseudo-class 'focus-visible-within' #388

@kongebra

Description

@kongebra

When running my Next.js project with --turbopack, the build fails due to a CSS parsing error. The same project builds and runs fine using the default webpack dev server.

Error shown:

'focus-visible-within' is not recognized as a valid pseudo-class. Did you mean '::focus-visible-within' (pseudo-element) or is this a typo?

This happens when parsing the following CSS from a dependency:

.md-autocomplete__input:focus-visible, 
.md-autocomplete__input:focus-visible-within {
  outline: none;
}

Notes:

  • Using Next.js 15.5.3
  • Only occurs with Turbopack, not Webpack
  • Import trace points to CSS inside @miljodirektoratet/md-css in the Autocomplete component

Printscreen:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions