Skip to content

Invalid "+" symbol used in generated CSS Module class name "Window_container__se0+Y" #1414

@mikeaustin

Description

@mikeaustin

Bug report

Actual Behavior

An invalid "+" symbol is used in generated CSS Module class names, such as "Window_container__se0+Y". Using document.querySelector('Window_container__se0+Y') returns null, when other class names without "+" are found.

Expected Behavior

All classes referenced by JS such as 'styles.container' should be accessible via document.querySelector(). document.querySelector('Window_container__se0+Y') returns null because it parses it as an adjacent-sibling operator.

How Do We Reproduce?

It may be difficult to reproduce because the class-names are auto-generated. I'm using "react-scripts": "5.0.0", which seems to be using css-loader "version": "6.5.1" when looking at the node_modules/css-loader/package.json.

...

Please paste the results of npx webpack-cli info here, and mention other relevant information

System:
OS: macOS 12.1
CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
Memory: 184.51 MB / 16.00 GB
Binaries:
Node: 14.18.1 - /usr/local/bin/node
npm: 6.14.15 - /usr/local/bin/npm
Browsers:
Chrome: 97.0.4692.99
Chrome Canary: 100.0.4859.0
Firefox: 95.0.2
Safari: 15.2
Safari Technology Preview: 15.4

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