-
-
Notifications
You must be signed in to change notification settings - Fork 211
v1.2.1 runs fine, but v1.2.2 throws error #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Nope, in that PR Tests are passed too. |
@detj What is the current version of webpack you use? webpack v1.x ? |
@ai okay, yes you are right. @michael-ciniawsky Yeah, I'm using webpack@v1.12.14. Sorry, I should have explained my problem in detail. So, my project is based on React Redux Starter Kit. It uses webpack@v1.x and has the following postcss config in its webpack config.
I recently moved my project to a new machine and ran npm install (yeah, I should have used yarn, I know, but otherwise I couldn't have discovered issues like these :)). After installing fresh
I read in the README of postcss-loader and postcss-load-config that the recommended way to now write postcss config is to create a Creating Also, there now seems to be multiple ways of loading postcss config including adding it in I'm sure I'm missing something, just don't know what exactly :) Thanks |
@detj Yep thats what I'm also interest in, bc normally options in Could you please do the following to help debugging cd node_modules/postcss-loader
editor index.js postcss-lodader/index.js
and run that with options in
package.json {
"devDependencies": {
"cssnano": "^3.10.0",
"postcss-nested": "^1.0.0"
},
"postcss": {
"parser": "sugarss",
"plugins": {
"postcss-nested": {},
"cssnano": { "autoprefixer": false }
}
}
} postcss.config.js (recommended) module.exports = (ctx) => ({
// works for both (file.sss, file.css) automatically
parser: ctx.webpack.resourcePath.endsWith('.sss') : 'sugarss' : false,
plugins: {
'postcss-nested': {}
'cssnano': ctx.env === 'production' ? {} : false // Will only load in production mode
}
}) |
@michael-ciniawsky That makes so much sense! Thank you for the detailed answer :) Okay, so I added a few console.log(params)
console.log(options)
I also added more logs to debug further
Is this helpful? Let me know if I should do more debugging. |
@detj Yep, thx I think we found the 'bug' 😛 , you use |
@detj In that starter project, I noticed for Although, if you're running tests, you probably don't need to waste the extra build time on css processing, so I would just pass |
@caseyduquettesc you're right. I did as you said and the tests are passing. But the thing is, tests were passing before and because of some change in this package (my guess), this error started showing up. Anyways, I'll update the react-redux-starter-kit about this development nonetheless. Appreciate it! Thanks. @michael-ciniawsky okay, will take a look when I have some time. thanks. 👍 |
This PR (#161) assumes that a
postcss.config.js
will always be present. But isn't this file optional? In my project, I was configuring postcss using Webpack 1.0 syntax as mentioned in the Readme.This works fine in v1.2.1, but breaks in v1.2.2 with the following error
This seems to be a breaking change and not support the Webpack 1.0 configuration model.
The text was updated successfully, but these errors were encountered: