You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I update koa-compose to the recently released version 3.0 I keep getting the following error:
TypeError: downstream.call(...)[(intermediatevalue)]isnotafunctionatObject.<anonymous> (/projects/intranet_redux/backend/node_modules/koa-mount/index.js:58:23)
at [object Generator].next (native)
at Object.<anonymous> (/projects/intranet_redux/backend/node_modules/koa-mount/index.js:60:14)
at [object Generator].next (native)
at Object.dispatch (/projects/intranet_redux/backend/node_modules/koa-router/lib/router.js:331:14)
at [object Generator].next (native)
at Object.<anonymous> (/projects/intranet_redux/backend/node_modules/koa-mount/index.js:58:23)
at [object Generator].next (native)
at Object.serve (/projects/intranet_redux/backend/node_modules/koa-static/index.js:41:14)
at [object Generator].next (native)
I tried looking at the commits from koa-compose since 2.3 but couldn't figure it out.
I currently use it like this
// protected route - check if user has a valid token & permissions for ressourceapp.use(mount('/api/v1/',compose([jwt({secret: publicKey,algorithm: 'RS256'}),permissionCheck(),apiRoutes.middleware()])));
The text was updated successfully, but these errors were encountered:
I ran into this same error today, but I found a solution you might find useful. First off, the error is occurring because koa-compose 3.0 has been upgraded to koa 2.0. Notably, ctx is now being passed as the first argument in middleware vs being referenced with this. That's why .call is breaking in this case.
I've forked koa-mount and updated the module to work with Koa 2.0. I'm not sure if this should be submitted as a PR, so I'll just link it here. Hope it helps!
Hello,
when I update koa-compose to the recently released version 3.0 I keep getting the following error:
I tried looking at the commits from koa-compose since 2.3 but couldn't figure it out.
I currently use it like this
The text was updated successfully, but these errors were encountered: