-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
TypeError: utils.compose(...)(...).then is not a function #10
Comments
Heya! Very thanks you are trying it and decided to use it! Used from day 1 of its publishing is very cool :) Hm. Strange. I'll look what happens. Cuz I can't figure out how to install two versions of one package as devDeps... Any ideas, btw? Thanks for reporting. edit: in anyway, fix (if any is needed) would be done on |
@apiep can you share what node version you are using? Cuz I don't have problems locally (node 6.6). let app = require('koa')()
let router = require('./index')()
router.resource('users')
app.use(router.legacyMiddleware())
app.listen(4242, () => {
console.log('Koa server listening on 4242')
router.getRoutes().forEach(route => {
console.log(route.path)
})
}) Also, try to clean npm and yarn caches, remove/delete their dirs in user home, remove yarn.lock and node_modules. Then try to just install the deps with i'll clone your repo too. |
I'm using node version 6.9.1 And what is inside your And sorry forgot to mention earlier, the error will appear when you access the url. The application startup is working normally and list all my url. But when I try it on postman the error shown. |
Mmmm yea. Confirmed. I think i figure it out why it is failing.
yea, the koa-rest-router index (the default export)
yea, noticed that Anyway. Partially my fault and partially npm's fault. This flatteing have its pluses, but minuses too. It installs koa-compose@<3 from Anyway. I'll push a patch in edit: Ooooh, that's sweeet, we have |
Maybe adding the package as a peerDeps? Sometimes I see something like this: And thanks for the support even if I just arrived at koa world 😅 |
haha, me too. I just thought to create
Ooooh, welcome! It's pretty cool and awesome! I have couple of more awesome koa packages starting with Jump directly on Koa v2 then :) We have couple of days until anything lower than node@4 is dropped totally and forever. |
@apiep thanks again! edit: I'm just publishing these routers cuz i'm thinking to create CI service, built on koa - CI service only for nodejs built on nodejs - it will be awesome! |
Your welcome man, glad this issue help your package. Never though it gonna be fixed in just 2 hour 😀 |
Me too. Come back if more problems appear. I'm always open. |
Hi, I just wanna try out koa and when I look on how to route it, I was amaze by how easy the
koa-rest-router
are. But when I use it with koa version 1, I got this error instead.koa version: ^1.2.4
koa-rest-router version: ^1.0.0
Error message
How I "mount" the router:
app.use(userRouter.legacyMiddleware())
How I write the router:
If you want to look the whole app you can check my repo: https://github.com/apiep/qiscus-vacation/blob/master/router/user.js
The text was updated successfully, but these errors were encountered: