-
Notifications
You must be signed in to change notification settings - Fork 512
webpack 2: Error in ... doesn't export content #282
Comments
It turns out that the problem was that I had my rule set up as: {
test: /\.css$/,
include: `${__dirname}/app`,
use: ExtractTextPlugin.extract({
loader: 'css-loader',
fallbackLoader: 'style-loader',
}),
}, instead of {
test: /\.css$/,
include: `${__dirname}/app`,
loader: ExtractTextPlugin.extract({
loader: 'css-loader',
fallbackLoader: 'style-loader',
}),
}, Basically, the code breaks for 'use', but not for 'loader'. It's my understanding that they are supposed to be the same thing for webpack 2. If that's the case, this may need to be fixed. |
I have used few hours to figure what's going on (and I actually did not, but went into recent issues and found this). Thanks a lot for sharing the solution. I think this is quite a critical issue in fact, since the docs suggest to use "use", but it does not work without any hint that you should use "loader". Hope this is fixed soon |
Related #265 |
@fraziermork thanks! changing |
It's only way that works for me: {
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: [
{
loader: 'css-loader',
query: {
modules: true,
importLoaders: 2,
sourceMap: true
}
}, {
loader: 'autoprefixer-loader',
query: {
browsers: 'last 2 version'
}
}, {
loader: 'sass-loader',
query: {
outputStyle: 'expanded',
sourceMap: true,
sourceMapContents: true
}
}
]
})
} Changing |
use -> loader worked for me as well. Banged my head for a half a day on this one. |
…d rule attributes 'loader' and 'query' instead of 'use' and 'options'. See webpack-contrib/extract-text-webpack-plugin#282 (comment) and webpack-contrib/extract-text-webpack-plugin#265 (comment)
I get the same error ".css doesn't export content" after updating the plugin from 2.0.0-beta.4 to 2.0.0-rc.2 my config is as following:
detailed error:
|
@ashraffayad Did you try |
@bebraw Actually yes. I tried the following. I still get the same error
|
@ashraffayad Can you open a separate issue with an example (repository)? I can't fix with partial information. |
Thanks. I will do that. |
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallbackLoader: "style-loader",
loader: "css-loader"
})
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallbackLoader: "style-loader",
- loader: ["css-loader?importLoaders=1","resolve-url-loader","sass-loader?sourceMap","postcss-loader"]
+ loader: [
+ { loader: 'css-loader', options: { importLoaders: 3, sourceMap: true } },
+ 'resolve-url-loader',
+ 'postcss-loader',
+ { loader: 'sass-loader', options: { sourceMap: true } }
+ ]
})
} @ashraffayad Can you show your
So maybe also - 'postcss-loader'
+ { loader: 'postcss-loader', options: { sourceMap: true } } |
@michael-ciniawsky Thanks for the effort. I will try the configuration you suggested. The problem appeared after I ran I configure postcss that way:
Don't mind the context: process.cwd(). It has not to do with the error :) update: Thanks you all. For me, the problem is solved. |
|
So how to solve? |
See this solution: towry/n#67 |
I've got the same error and I just solved it. For me, it's because I didn't use the BannerPlugin in a right way. Just change the input value, remove the extra |
I am trying to follow the instructions in the readme in the simplest test-case possible and encountering errors. I am using webpack 2.1.0-beta.25 and extract-text-webpack-plugin 2.0.0-beta.4. Below is webpack config:
For reference, my entry.js looks like this:
This is the error I'm getting:
I'm not sure what the difference is between my code and the instructions in the readme. Here is the repo with the current code.
The text was updated successfully, but these errors were encountered: