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
[2.0.1] 'No PostCSS Config found' (options.config) #209
Comments
Now I'm getting other type of error messages: Module build failed: TypeError: Cannot create property 'prev' on boolean 'false'
at Promise.resolve.then.then (C:\Users\Uriziel\ponteus\wp-content\themes\ponteus\node_modules\postcss-loader\lib\index.js:125:47) |
Did you update to |
Yes, I've updated everything and even cleaned npm cache. 😃 |
You make me sweat here :D, mom I will investigate |
I am getting the same error using the
I am using (what I think is) a pretty standard
|
Don't use starter kit, and tried to update to postcss-loader 2.0.1, still have |
- excludes lodash, bootstrap-switch and the latest mock (outstanding pr address that) - holding off on post-css loader till this is resolved: webpack-contrib/postcss-loader#209
Had the same issue after installing the latest postcss-loader, so I reverted back to:
|
I'm also getting the original error (using |
To clarify I do have |
Please try the fix branch and provide feedback 😛 @iAdramelk I'm especially interested in your setup :D |
No PostCSS Config found
No PostCSS Config found
No PostCSS Config found
Same error here since I've upgrade:
Basicaly I was doing this: // ===========================
// LOADERS
// ===========================
module: {
rules: [
{
test: /\.scss$/,
use: ExtractCSSPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'sass-loader']
})
},
{
test: /\.css$/,
use: ExtractCSSPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader']
})
}
]
},
// ===========================
// PLUGINS
// ===========================
plugins: [
// LOADER OPTIONS PLUGIN
new webpack.LoaderOptionsPlugin({
options: {
postcss: [
autoprefixer()
]
}
}),
// EXTRACT CSS PLUGIN
new ExtractCSSPlugin({
filename: '[name].[contenthash:8].css',
disable: config.debug
})
]
} If you want to see the complete config I just made a gist: |
@iAdramelk Thx I will take a look as soon as possible :) |
@iAdramelk Fixed && Released in v2.0.4 I was sloppy... 😛 |
Is postcss.config.js actually required, can't I just specify the options directly in my webpack.config? |
@JPortegijs Both are supported && loading hierarchy is |
@michael-ciniawsky yep, no more error! Thank you very much. |
Everything good here, too! Thanks! |
still getting the mentioned error on postcss-loader@2.0.5 using
|
I need to add this to the README... 😛 @th3fallen **webpack.config.js {
test: /\.css$/,
use: [
...,
...,
{ loader: 'postcss-loader', options: { plugins: [ require('autoprefixer')(options)) ] } }
]
} |
new webpack.LoaderOptionsPlugin({
minimize: false,
debug: true,
- options: {
- postcss: [autoprefixer({ browsers: ['last 2 versions'] })],
- },
}), |
@michael-ciniawsky thanks for the input but how would i manage that in this syntax?
|
**webpack.config.js // webpack 2 module.loaders => module.rules
{
test: /\.(scss|css)$/,
use: [ // webpack 2 loader => use
'style-loader'
{ loader: 'css-loader', options: { importLoaders: 2 }, // needed for webpack @import handling
{ loader: 'postcss-loader', options: { plugins: [ require('autoprefixer')(options)) ] } },
{ loader: 'sass-loader', options: { includePaths: [ /* path/to/@imports */ ]}
]
} |
thanks @michael-ciniawsky that works for my dev env. but in my productions build that's formatted like this...
im getting...
any ideas? |
@th3fallen |
so why would that exact same config work for my dev environment? |
|
@th3fallen latest and please remove {
test: /\.(scss|css)$/,
- loader: ExtractTextPlugin.extract({
+ use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
- 'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: { plugins: [require('autoprefixer')({ browsers: ['last 2 versions'] })] },
},
'sass-loader',
],
publicPath,
}),
}, |
@michael-ciniawsky yep, what you suggested works, not sure why not it does... |
|
no, i get 1 css file but that's what's expected from my build thanks so much for the help. |
Kept getting
until I added: {
test: /\.scss$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader', options: {
modules: true,
importLoaders: 3,
localIdentName: '[name]__[local]__[hash:base64:5]'
}
}, {
loader: 'postcss-loader', options: {
+ plugins: [require('autoprefixer')]
}
}, {
loader: 'resolve-url-loader'
}, {
loader: 'sass-loader', options: {
outputStyle: 'expanded',
sourceMap: true
}
}]
}, Now all compiles great. thanks all. |
@heisian That's the intended behaviour, either the setup (plugins && options) is specified in |
that config was in my what is an AST? I apologize but this is about my 6th day of using Webpack in this manner. Random tweaking has gotten me successful configs for both dev and production, however I could very well stand to learn more about what's actually going on here. So.. why does adding the |
You need one
AST => Abstract Syntax Tree File (Source) .class {
width: 25%;
} Interface (Syntax)
AST (PostCSS) Root {
raws: { semicolon: false, after: '\n' },
type: 'root',
nodes:
[
Rule {
raws: [Object],
type: 'rule',
nodes: [Object],
parent: [Circular],
source: [Object],
selector: '.class',
lastEach: 2,
indexes: {}
}
],
source:
{
input:
Input {
css: '.class {\n width: 25%;\n}\n',
file: './src/index.css'
},
start: { line: 1, column: 1 }
},
lastEach: 2,
indexes: {}
}
In theory you could of course parse the CSS and stringify it back without any plugins (transforms), but this computation is unnecessary/useless then 😛 |
@michael-ciniawsky can we close conversation here? If someone want to write about bug or other stuff, let create new issue. |
Yep, you can lock the thread anytime if you want 😛 |
If someone has problems, please create a new issue. Thanks! |
After todays upgrade to postcss-loader 2.0.0 I'm getting
No PostCSS Config found
everywhere.I'm using
weback.config.js
from https://github.com/JeffreyWay/laravel-mix repositoryMy actual postCss options are:
The text was updated successfully, but these errors were encountered: