馃悰
I use css-modules in my project and it suddenly starts to throw an error when I do some changes in the css files (for js changes all works fine)
Server running at http://localhost:1234
馃毃 /Users/yiooxir/projects/test/react-parcel-example/index.css:undefined:undefined: Cannot read property 'postcss' of null
at Processor.normalize (/Users/yiooxir/projects/test/react-parcel-example/node_modules/parcel-bundler/node_modules/postcss/lib/processor.js:136:12)
I found out that when the css modules is off postcss: modules: false all work as expected.
It also can be reproduced on the react-parcel-example if you switch in the package.json postcss: modules to true.
// .babelrc
{
"presets": ["react-app"]
}
Rebundle process stops with error:
Server running at http://localhost:1234
馃毃 /Users/yiooxir/projects/test/react-parcel-example/index.css:undefined:undefined: Cannot read property 'postcss' of null
at Processor.normalize (/Users/yiooxir/projects/test/react-parcel-example/node_modules/parcel-bundler/node_modules/postcss/lib/processor.js:136:12)
at new Processor (/Users/yiooxir/projects/test/react-parcel-example/node_modules/parcel-bundler/node_modules/postcss/lib/processor.js:51:25)
at postcss (/Users/yiooxir/projects/test/react-parcel-example/node_modules/parcel-bundler/node_modules/postcss/lib/postcss.js:73:10)
at module.exports (/Users/yiooxir/projects/test/react-parcel-example/node_modules/parcel-bundler/src/transforms/postcss.js:13:19)
at <anonymous>
Application bundled successfully at first time and error is appearing when we make changes in any css file only.
can be reproduced on react-parcel-example
installed packages list can be found on react-parcel-example
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.6.0
| Node | 8.4.0
| Yarn | 1.0.2
| Operating System | mac os
+1. I鈥檓 fairly sure this issue arose for me after I upgraded to from Parcel 1.5.1 to Parcel 1.6.2.
鈥ope. rolled back to 1.5.1 and the issue remained, at least for me.
Hi @meowgorithm,
Not sure if this will help you but I got the same error when trying to configure postcss inside of my package.json file.
The error disappeared when I switched to using the .postcssrc config file.
I'm using [email protected].
@matthewlynch Thanks, Matt! I did exactly that and now things are working as they should (as of [email protected]).
Thanks, @meowgorithm !! It looks like it solved my problem too!
Maybe somebody encountered such a problem when you make a change in css file - parcel rebuilds only css, so appropriate class in the html lost their relative css rules becouse css hash changed only in css ?
Most helpful comment
Hi @meowgorithm,
Not sure if this will help you but I got the same error when trying to configure postcss inside of my
package.jsonfile.The error disappeared when I switched to using the
.postcssrcconfig file.I'm using
[email protected].