Open MatthewAry opened 8 months ago
The solution is to put a Nope that didn't work./
in the first route I think. If having the path string empty is bad, then maybe TS should throw an error for using an empty string.
It seems that this issue is caused because there is a conflict with how routes are getting resolved. /:id
will accept any string between slashes, but the first route is an empty string. Normally you would expect that routes declared before something like a parameterized path would be checked before matching parameterized routes. Elysia probably does this, but Eden Treaty 2's TS path resolver doesn't seem to be handling this condition very well. There's probably more to this, but this is what I'm seeing so far.
Should be fixed in Elysia 1.0.0-rc.11, and Eden 1.0.0-rc.3.
Please see https://github.com/MatthewAry/elysia-reproductions/tree/treaty2-cant-resolve-some-routes
If you do something like this:
Eden treaty 2 will not be able to resolve using TS the second route.