Skip to content

CSS modules - Can't use a class named "default" #839

@StyleShit

Description

@StyleShit

Reproduction link or steps

https://github.com/StyleShit/repros/tree/main/tsdown-css-modules-default

What is expected?

When I have this CSS, it should be generated as css module:

// index.module.css

.default {
  color: red;
}

What is actually happening?

I'm getting this error:

ERROR  Error: Build failed with 1 error:

[PARSE_ERROR] Error: Identifier expected. 'default' is a reserved word that cannot be used here.
   ╭─[ src/index.module.css:1:14 ]
   │
 1 │ export const default = "design-system-default";
   │              ───┬───  
   │                 ╰───── 
───╯

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions