kriasoft / kriasoft/webpack-middleware

TypeError: callback is not a function

Open
#7 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16
Forks
5
PR merge metrics
No merged PRs in 30d

Description

I am trying to upgrade to webpack 4 from 2. Getting the following of webpack-middleware error while running the server.

Versions:
Webpack: 4.34.0
webpack-middleware: 1.5.1
node: 10.0.0

TypeError: callback is not a function
at invalidAsyncPlugin (/Users/nilofer/workplace/node_modules/webpack-middleware/middleware.js:104:3)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/nilofer/workplace/node_modules/tapable/lib/HookCodeFactory.js:33:10), :18:1)
at AsyncSeriesHook.lazyCompileHook (/Users/nilofer/workplace/node_modules/tapable/lib/Hook.js:154:20)
at Watching._go (/Users/nilofer/workplace/node_modules/webpack/lib/Watching.js:40:32)
at Watching.compiler.readRecords.err (/Users/nilofer/workplace/node_modules/webpack/lib/Watching.js:32:9)
at Compiler.readRecords (/Users/nilofer/workplace/node_modules/webpack/lib/Compiler.js:479:11)
at new Watching (/Users/nilofer/workplace/node_modules/webpack/lib/Watching.js:29:17)
at Compiler.watch (/Users/nilofer/workplace/node_modules/webpack/lib/Compiler.js:207:10)
at runWithDependencies (/Users/nilofer/workplace/node_modules/webpack/lib/MultiCompiler.js:203:30)
at asyncLib.map (/Users/nilofer/workplace/node_modules/webpack/lib/MultiCompiler.js:178:6)
at arrayEachIndex (/Users/nilofer/workplace/node_modules/neo-async/async.js:2548:9)
at Object.map (/Users/nilofer/workplace/node_modules/neo-async/async.js:2900:9)
at runCompilers (/Users/nilofer/workplace/node_modules/webpack/lib/MultiCompiler.js:175:13)
at MultiCompiler.runWithDependencies (/Users/nilofer/workplace/node_modules/webpack/lib/MultiCompiler.js:187:3)
at MultiCompiler.watch (/Users/nilofer/workplace/node_modules/webpack/lib/MultiCompiler.js:198:9)
at module.exports (/Users/nilofer/workplace/node_modules/webpack-middleware/middleware.js:129:27)
at /Users/nilofer/workplace/frontend-utilities/tools/start.js:92:26
at new Promise (/Users/nilofer/workplace/node_modules/babel-cli/node_modules/core-js/modules/es6.promise.js:177:7)
at /Users/nilofer/workplace/tools/start.js:23:9
at Generator.next ()
at step (/Users/nilofer/workplace/tools/start.js:175:191)
at /Users/nilofer/workplace/tools/start.js:175:361

Commenting it, the code works. But unable to resolve this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at node_modules/webpack-middleware/middleware.js:104 and trace the call from tools/start.js:92 under Webpack 4.34.0, webpack-middleware 1.5.1, and Node 10. Compare the middleware's async callback expectations with the reported stack trace. Done means the server runs with the relevant code enabled and no TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, node.js, webpack
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.