Skip to content

mini-css-extract-plugin Callback was already called. #577

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

Closed
shaobeichen opened this issue Aug 28, 2020 · 9 comments
Closed

mini-css-extract-plugin Callback was already called. #577

shaobeichen opened this issue Aug 28, 2020 · 9 comments

Comments

@shaobeichen
Copy link

  • Operating System: Mac Mojave 10.14.3
  • Node Version: v10.13.0
  • NPM Version: 6.4.1
  • webpack Version: 4.8.3
  • mini-css-extract-plugin Version: 0.10.0

Expected Behavior

html-loader attrs: ['img:src', 'link:href'] can be used with MiniCssExtractPlugin.loader without error

Actual Behavior

An error occurred when html-loader attrs: ['img:src', 'link:href'] and MiniCssExtractPlugin.loader were used together

Code

{
    test: /\.css$/i,
    exclude: /node_modules/,
    use: [
        MiniCssExtractPlugin.loader,
        'css-loader',
    ]
},
{
    test: /\.(htm|html)$/i,
    exclude: /node_modules/,
    use: [
        {
            loader: 'html-loader',
            options: {
                attrs: ['img:src', 'link:href']
            }
        },
    ]
},
/Users/xxx/project/landing2/node_modules/webpack/node_modules/neo-async/async.js:16
    throw new Error('Callback was already called.');
    ^

Error: Callback was already called.
    at throwError (/Users/xxx/project/landing2/node_modules/webpack/node_modules/neo-async/async.js:16:11)
    at /Users/xxx/project/landing2/node_modules/webpack/node_modules/neo-async/async.js:2818:7
    at process._tickCallback (internal/process/next_tick.js:61:11)

How Do We Reproduce?

"css-loader": "^0.28.11",
"html-loader": "^0.5.5",
"mini-css-extract-plugin": "^0.10.0",
"style-loader": "^0.21.0",
"webpack": "^4.8.3",

According to the above configuration, an error will occur

@alexander-akait
Copy link
Member

alexander-akait commented Aug 28, 2020

@LeachZhou Update webpack, css-loader and mini-css-extract-plugin to latest version. If it is not help, please create reproducible test repo and I will reopen issue

@shaobeichen
Copy link
Author

@LeachZhou Update webpack, css-loader and mini-css-extract-plugin to latest version. If it is not help, please create reproducible test repo and I will reopen issue

@evilebottnawi I tried to update to the latest version, but I still got an error

"css-loader": "^4.2.2",
"mini-css-extract-plugin": "^0.11.0",
"webpack": "^4.44.1",
/Users/xxx/project/landing2/node_modules/_neo-async@2.6.2@neo-async/async.js:16
    throw new Error('Callback was already called.');
    ^

Error: Callback was already called.
    at throwError (/Users/xxx/project/landing2/node_modules/_neo-async@2.6.2@neo-async/async.js:16:11)
    at /Users/xxx/project/landing2/node_modules/_neo-async@2.6.2@neo-async/async.js:2818:7
    at process._tickCallback (internal/process/next_tick.js:61:11)

@shaobeichen
Copy link
Author

@evilebottnawi
https://github.com/LeachZhou/loading2

How to reproduce

  1. command line
npm i
npm run dev

@alexander-akait
Copy link
Member

@shaobeichen
Copy link
Author

shaobeichen commented Aug 31, 2020

Update dependencies please https://github.com/LeachZhou/loading2/blob/master/package.json

@ericclemmons already updated

@aexvir
Copy link

aexvir commented Sep 1, 2020

I'm having the same issue 🤔️

"css-loader": "^4.2.2",
"mini-css-extract-plugin": "^0.11.0",
"style-loader": "^1.2.1",
"webpack": "^4.44.1",

@shaobeichen
Copy link
Author

@evilebottnawi help us check this issue,please

@alexander-akait
Copy link
Member

alexander-akait commented Sep 2, 2020

@LeachZhou Please run npm outdate and update all deps, you provide broken example, a lot of dependencies are missed in package.json, same strange things in configuration like UglifyJsPlugin and TerserPlugin, you don't need two plugins for minify JS, optimize-css-assets-webpack-plugin replaced by https://github.com/webpack-contrib/css-minimizer-webpack-plugin, you don't need webpack.HotModuleReplacementPlugin because webpack-dev-server automatically inject this plugin.

Bug on html-webpack-plugin side, investigate

SECURITY WARNING: remove accessKey and secretKey from your repo, you leak access

@alexander-akait
Copy link
Member

Duplicate #489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants