[next] 🐞 collect()
fails on a particular CSS snippet from bootstrap 4
#217
Labels
collect()
fails on a particular CSS snippet from bootstrap 4
#217
Do you want to request a feature or report a bug?
🐞 bug
What is the current behavior?
While server rendering, during collection of critical CSS, the following error is being emitted:
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.In my crazy setup, linaria receives a particular snippet of CSS, originally from Bootstrap 4 SASS, via
sass-loader
->postcss-loader
->css-loader
->extract-css-chunks-webpack-plugin
->webpack-flush-chunks
, via some hackery. So far so good, but when I proceeded to server-renderer,collect()
choked on it.Here is this snippet:
It is reproducible without bootstrap/sass/postcss. Just paste the snippet and linaria will gladly kill the server.
Here is the repro:
git clone https://github.com/ivan-aksamentov/reactlandia-bolerplate-lite -b repro/linaria-collect cd reactlandia-bolerplate-lite git checkout c86b1938ad7d58f4d693ba848144cb12358b3ec6 npm install npm run dev
http://localhost:3000
Files of interest:
collect()
call isWhat is the expected behavior?
collect()
should return successfullyPlease provide your exact Babel configuration and mention your Linaria, Node, Yarn/npm version and operating system.
babel.config.js
:versions:
Workaround
Well, obviously, I could (and I did) shut up the error by adding null-checks in conditional in /src/server/collect.js:27:
However, I don't fully understand (yet?) how
collect()
works, and whether this workaround will affect the correctness. So, I think this should be considered by maintainers.CC: @thymikee @satya164
The text was updated successfully, but these errors were encountered: