Koa2 support - next is not a function?
See original GitHub issueHi guys,
I’m trying to tweak this example to work with Koa2
https://github.com/kristianmandrup/vue-hackernews-2.0
However I get a strange error:
According to the call stack, koa-compose
ends up calling webpack-dev-middleware
which expects a next
argument.
Maybe related to this issue ?? or this?
TypeError: next is not a function
at goNext (/Users/kristianmandrup/repos/aurelia-projs/ai/vue-hackernews-2.0/node_modules/webpack-dev-middleware/middleware.js:194:41)
at webpackDevMiddleware (/Users/kristianmandrup/repos/aurelia-projs/ai/vue-hackernews-2.0/node_modules/webpack-dev-middleware/middleware.js:206:33)
at dispatch (/Users/kristianmandrup/repos/aurelia-projs/ai/vue-hackernews-2.0/node_modules/koa-compose/index.js:43:32)
at /Users/kristianmandrup/repos/aurelia-projs/ai/vue-hackernews-2.0/node_modules/koa-compose/index.js:36:12
at Server.<anonymous> (/Users/kristianmandrup/repos/aurelia-projs/ai/vue-hackernews-2.0/node_modules/koa/lib/application.js:136:7)
at emitTwo (events.js:106:13)
at Server.emit (events.js:191:7)
at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:546:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Next is not a function when trying to call an API endpoint
js with Koa and i'm getting an error TypeError: next is not a function I'm using koa and koa-mount to modularize my API....
Read more >Koa - next generation web framework for node.js
Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust...
Read more >koa - npm
Expressive HTTP middleware framework for node.js to make web applications and APIs more enjoyable to write. Koa's middleware stack flows in ...
Read more >Koa2 NPM | npm.io
Koa is not bundled with any middleware. Installation. Koa requires node v4.0.0 or higher for (partial) ES2015 support. $ npm install koa@next. Hello...
Read more >Egg@2 Upgrade guideline - Egg - Eggjs.org
DO NOT support 1.x role definition, because koa-roles is no longer compatible. ... Use Koa 2's (ctx, next) arguments style in callback function....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you can use
koa-webpack-dev-middleware
andkoa-webpack-hot-middleware
, and wrap them byconvert
if you use koa2doesn’t support webpack 5 unfortunately and this answer is very old but good suggestion at it’s time tho