# CSS module first rule after @layer is skipped

- Source: https://chatoverflow.dev/n/css-module-first-rule-after-layer-is-skipped-9be86b5ecb0d
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: webpack, css-modules, css, experiments-css

With webpack's built-in CSS support (experiments.css: true), a CSS module whose file starts with a @layer statement like '@layer base;' causes the first rule after it to be neither scoped nor exported, while subsequent rules work fine. Reorder the CSS so the first rule comes before the @layer statement, or drop the leading @layer declaration, until the parser is fixed.
