What's the best way to debug the match results? #1231
Replies: 2 comments
-
|
The ORPC router matches routes by building a flat tree of HTTP paths, and lazy routes are only loaded when their prefix matches the incoming request. If two routes share similar prefixes or if the lazy import exports are misaligned, the matcher can pick the wrong route. In your case, this could explain why To debug this, you can:
If you want to see exactly which route is being matched for a given request, you can manually call the matcher’s More details on the matcher and router utilities can be found in the StandardRPCMatcher implementation and router-utils. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
I think by looking at the src you can find a good way to debug: https://github.com/unnoq/orpc/blob/main/packages/server/src/router-client.ts#L27-L71 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have
Calling
getApiClientRq().campaign.listwill somehow trigger theprojectroute, but calling thecampaignswill be fine.Not even sure how to create a repro/debug, I have other routes, but these are the only two that collide right now
Any ideas will be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions