react-scoped-styles icon indicating copy to clipboard operation
react-scoped-styles copied to clipboard

"|" in className breaks compilation

Open constgen opened this issue 4 years ago • 0 comments

Using vertical line in the slassName breaks compilation as it produces invalid JavaScript code

<div className="test-classname | test" />

I know this is weird. But this is valid HTML and should not fail.

The error is thrown during the build time

ERROR in ./src/images/Image.jsx 47:50
Module parse failed: Unexpected token (47:50)

Actual className

className: "images-ffe673fcf7-test-classname" test"

Expected className

className: "images-ffe673fcf7-test-classname images-ffe673fcf7-test"

constgen avatar Oct 08 '20 18:10 constgen