Closed danyim closed 7 years ago
(Emitted value instead of an instance of error) the same, when i use postcss-loader vue-cli@2+ (.scss or other,not .vue)
@danyim look at this https://github.com/postcss/postcss-loader/commit/159b66a
I switch to a low version @1.3.3
@danyim The typo should be fixed on master already, thx 😛 . Can you try without sourceMapContents: !isDev
in sass-loader
options? I will test it in a few minutes
@danyim I can't reproduce this in a small local test, could you please setup a small repo for debugging ?
Feel free to reopen if still regressions and please provide a small test repo, since I couldn't reproduce this myself
Hello,
Postcss-loader: 2.0.6 Webpack: 2
I still have the warning "Previous source map found, but options.sourceMap isn't set." Here is part of my webpack.config.js :
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader?module&importLoaders=1&localIdentName=[local]_[hash:base64:5]',
'postcss-loader',
'sass-loader?sourceMap'
]
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
plugins: [
//'transform-react-jsx',
[
'react-css-modules',
{
"generateScopedName": "[local]_[hash:base64:5]",
"filetypes": {
".scss": "postcss-scss"
},
"webpackHotModuleReloading": true
}
]
]
},
}
}
Thank you for your help
@Janaka-Steph sass-loader
(generates map
) => postcss-loader
(gets prev map
from sass-loader
, but doesn't update it, without ?sourceMap
) => ⚠️
+ 'postcss-loader?sourceMap',
'sass-loader?sourceMap'
@Janaka-Steph I got around this by adding sourceMap: true
to my postscss-loader config - so in your case, adding ?sourceMap
to postcss-loader
may help.
Dah! @michael-ciniawsky wins the day! 🌮 🌮 for you.
No it doesn't work for me :-( I tried what you said, I tried sourceMap everywhere, nowhere, in postcss.config, true, false. Nothing works. I don't know what to do
@Janaka-Steph Here's exactly what I changed in my config to get rid of the warning.
{
test: /\.scss$/,
use: [
'style-loader',
cssModulesLoader,
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
sourceMap: true, // <-------- Added this line
plugins: () => postcssConfig
}
},
'sass-loader?sourceMap'
}
Nope :-/ I print the error, maybe you understand something at this.
client?cd17:43 ./~/css-loader!./~/postcss-loader/lib!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"preBootstrapCustomizations":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/ui/assets/theme/pre-customizations.scss","bootstrapCustomizations":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/ui/assets/theme/customizations.scss","appStyles":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/ui/assets/theme/app.scss","extractStyles":false,"styleLoaders":["style-loader","css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","reboot","type","images","code","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","responsive-embed","close","badge","modal","tooltip","popover","carousel","utilities"],"scripts":["alert","button","carousel","collapse","dropdown","modal","popover","scrollspy","tab","tooltip","util"],"configFilePath":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/.bootstraprc","bootstrapPath":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js
(Emitted value instead of an instance of Error)
⚠️ PostCSS Loader
Previous source map found, but options.sourceMap isn't set.
In this case the loader will discard the source map entirely for performance reasons.
See https://github.com/postcss/postcss-loader#sourcemap for more information.
@ ./~/style-loader!./~/css-loader!./~/postcss-loader/lib!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"preBootstrapCustomizations":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/ui/assets/theme/pre-customizations.scss","bootstrapCustomizations":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/ui/assets/theme/customizations.scss","appStyles":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/ui/assets/theme/app.scss","extractStyles":false,"styleLoaders":["style-loader","css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","reboot","type","images","code","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","responsive-embed","close","badge","modal","tooltip","popover","carousel","utilities"],"scripts":["alert","button","carousel","collapse","dropdown","modal","popover","scrollspy","tab","tooltip","util"],"configFilePath":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/.bootstraprc","bootstrapPath":"/Users/steph/Desktop/PRO/Projects/dao1901_NewDawn/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js 4:14-1454 18:2-22:4 19:20-1460
@ ./~/bootstrap-loader/lib/bootstrap.loader.js!./~/bootstrap-loader/no-op.js
@ ./~/bootstrap-loader/loader.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server bootstrap-loader
Maybe it is due to bootstrap-loader ?
Here is the repo if you want to have a look: https://github.com/asseth/dao1901/tree/develop
@michael-ciniawsky I created one, too. Here is the repo if you want to have a look: https://github.com/yoyo837/postcss-loader-248
@matthopson That doesn't fix the problem properly. The a source map is needed for production, so by enabling it in development environment, you are increasing the build time, because it has to generate a Source map, which is really not needed, because while developing, your CSS is not minified.
So far, the only thing that fixes it for me is moving to postcss-loader@1.3.3
.
I'm seeing these warnings:
when my Webpack config explicitly sets the option to true:
Is there something I am misconfiguring? Or is this a bug? Also, "enterily" is typoed in the warning text.