Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

PostCSS error in version 0.15.8 #311

Closed
1 of 4 tasks
kirill-konshin opened this issue May 26, 2017 · 15 comments
Closed
1 of 4 tasks

PostCSS error in version 0.15.8 #311

kirill-konshin opened this issue May 26, 2017 · 15 comments

Comments

@kirill-konshin
Copy link

kirill-konshin commented May 26, 2017

This issue is a: Bug Report

  • Bug report
  • Feature request
  • Question / support request
  • Other

Got the following error for any given css file after upgrade to 0.15.8 from 0.15.6:

Module build failed: TypeError: Cannot read property 'postcss' of null
    at Processor.normalize (/Users/xxx/node_modules/postcss/lib/processor.js:136:12)
    at new Processor (/Users/xxx/node_modules/postcss/lib/processor.js:51:25)
    at postcss (/Users/xxx/node_modules/postcss/lib/postcss.js:73:10)
    at /Users/xxx/node_modules/postcss-loader/index.js:122:16
    at process._tickCallback (internal/process/next_tick.js:103:7)
@insin
Copy link
Owner

insin commented May 28, 2017

I also hit this while working on v0.15.8, but the Webpack version bump in the release fixed it for me.

Have you tried a re-install of your node_modules if you're using npm3? Non-determinism!

@kirill-konshin
Copy link
Author

Yes, I did removed node_modules and made complete reinstall.

@kirill-konshin
Copy link
Author

I am using NPM version 4.3.0. Webpack version is 2.6.1. I have also upgraded nwb-sass to 0.8.0 but the issue persists.

@insin
Copy link
Owner

insin commented May 30, 2017

Do you have a repo I can use to reproduce this locally?

@kirill-konshin
Copy link
Author

kirill-konshin commented May 30, 2017

After long debug I have figured that the issue occurs because of CSS import from SCSS file:

@import "~react-datetime/css/react-datetime.css";

.rdt {
    // stuff
}

Surprisingly, it works w/o extension:

@import "~react-datetime/css/react-datetime";

As I said, it used to work with 0.15.6.

@insin
Copy link
Owner

insin commented May 30, 2017

Every loader involved in handling styles had a major version bump since 0.15.x so I'll trawl the changelogs and issues to see if anything sticks out.

@alexander-akait
Copy link

alexander-akait commented May 30, 2017

Related to css-loader and postcss-loader(little) webpack-contrib/postcss-loader#234 (comment)

@tnrich
Copy link

tnrich commented May 31, 2017

I'm also hitting this issue with the latest nwb v0.16.3
Thanks for the hard work @insin :)

@insin
Copy link
Owner

insin commented May 31, 2017

Thanks for the investigation @evilebottnawi

@tnrich
Copy link

tnrich commented Jul 4, 2017

@insin any update on this? None of the newer versions work for me..
Here is the offending line of css:
@import url(~@blueprintjs/core/dist/blueprint.css);

@insin
Copy link
Owner

insin commented Jul 5, 2017

Does anyone have a sample repo I can use to reproduce this?

@tnrich
Copy link

tnrich commented Jul 5, 2017

I think a simple one would be the base nwb setup for a react component plus yarn install @blueprint/core and then in the demo/index.js file have a require of @import url(~@blueprintjs/core/dist/blueprint.css);

@insin
Copy link
Owner

insin commented Jul 5, 2017

According to webpack-contrib/postcss-loader#258, ident is needed again for postcss config to work.

nwb no longer adds this as I thought recent versions of Webpack automatically handled passing options properly, but I guess not, as @import url(~@blueprintjs/core/dist/blueprint.css); works once I add an ident to postcss-loader's options.

@insin insin closed this as completed in 8184960 Jul 7, 2017
@tnrich
Copy link

tnrich commented Jul 7, 2017

Thank you!!

@insin
Copy link
Owner

insin commented Jul 7, 2017

Fix released in:

  • v0.17.3 (default version) - Webpack 2, works in npm2 if you're stuck on it
  • v0.18.4 (nwb@next) - Webpack 3, updated dependencies, new features, doesn't work in npm2 yet due to Webpack plugin peerDependencies)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants