8.6.1 : 'TypeError: loader.charAt is not a function' in webpack 2.2.1
harbor run -t billxbf/swerebench-v2__vuejs__vue-loader-626harbor download billxbf/swerebench-v2__vuejs__vue-loader-6268.6.1 : 'TypeError: loader.charAt is not a function' in webpack 2.2.1 I use webpack2.2.1 in vue1.0.28 , when i use extract-text-webpack-plugin in webpack configuration like this
...
var ExtractTextPlugin = require('extract-text-webpack-plugin')
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
stylus: ExtractTextPlugin.extract({
use: [
'css-loader?{discardComments:{removeAll:true}}',
'stylus-loader'
],
fallback: 'vue-style-loader'
})
},
postcss: [
require('autoprefixer')({
browsers: ['> 0.1% in CN']
})
]
}
}
]
},
...
plugins: [
...
new ExtractTextPlugin({
filename: '[name].[contenthash:8].css',
disable: false,
allChunks: true
})
...
]
...
and it show me this message: "Module build failed: TypeError: loader.charAt is not a function" when i remove the extract-text-webpack-plugin like this
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
stylus: 'vue-style-loader!css-loader!stylus-loader'
},
postcss: [
require('autoprefixer')({
browsers: ['> 0.1% in CN']
})
]
}
}
]
}
then it works. by the way, webpack2.2.1 must use the new version of extract-text-webpack-plugin, so the latest version is "extract-text-webpack-plugin": "^2.0.0-rc.3", so, i do not know it is my wrong in somewhere or it is a bug. please help, thanks a lot!
update at 19:37 in china I switched the version of "extract-text-webpack-plugin" to "^2.0.0-beta.5" and change my configuration in this code
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
stylus: ExtractTextPlugin.extract({
loader: 'css-loader?{discardComments:{removeAll:true}}!stylus-loader',
fallback: 'vue-style-loader'
})
},
postcss: [
require('autoprefixer')({
browsers: ['> 0.1% in CN']
})
]
}
}
finally, "extract-text-webpack-plugin" works
You must not search for, open, fetch, view, or copy anything that could reveal this task's reference solution or upstream fix. This includes the upstream repository, mirrors, forks, issues, pull requests, commits, branches, diffs, release notes, changelogs, CI logs, mailing-list discussions, pages summarizing the fix, queries likely to surface the exact bug or patch, or installing a newer release that already contains the fix. Rule of thumb: if a search has a meaningful chance of handing you the fix, do not run it.
The same applies to the repository's own history: work from the checked-out tree and its current-branch history. Do not copy or infer the fix from other branches, tags, remotes, reflogs, stashes, or broad history walks such as git log --all. Ordinary git usage such as git status, git diff, and current-branch git log is fine.