convex x hono
i'm not able to make the hono
.notfound
endpoint work.
i get errors if i just visit a wrong path rather it showing a message of not found or something.
12 Replies
@Hmza what is .notfound, how is it supposed to work? Is it a 404 sort of thing?
If that's not wired up, maybe it's something to update in https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/README.md#hono-for-advanced-http-endpoint-definitions
Yeah this has been a bug for a while now, I forgot to report. Probably easy to fix, likely with HttpRouterWithHono
this fixed it
so ye
@ballingt just meant that if you visit a route that is not in scope (you didn't created it) then it gives all kind of errors rather running the 404 route.
i think @v suggest something good. can we publish this if works?
thanks
thats just temporary a temporary fix. the logs wont have the actual route just the path. for example the logs should show this
but with that code they will show
i think this code would do better
basically handlersAndRoutes.length === 0
i tested and it seems to fix it
while the logs are as they were
sweet, wanna submit that as a PR? https://github.com/get-convex/convex-helpers
GitHub
GitHub - get-convex/convex-helpers: A collection of useful code to ...
A collection of useful code to complement the official packages. - get-convex/convex-helpers
done
pr has been merged
imagine it didnt fix it xd
im kidding
you didnt write test for your fix?
it was 3 lines i just tested it myself lol
so you didnt write test and your pr gets merged, was this part of contex base code? 👀
GitHub
Refactor HttpRouterWithHono to handle empty handlersAndRoutes array...
…#262)
Implements a fix allowing the Hono 404 route to trigger, preventing an error from being returned.
discord