encoredev / encore

Development Platform for building robust type-safe distributed systems with declarative infrastructure

Home Page:https://encore.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raw endpoints unable to capture route params

tuckers-tech opened this issue · comments

Hey Encore team! I came across an issue today where I need some guidance on a path forward. When using the TS raw endpoints on a route that is static (no params) it works wonderfully. When adding an addition of a route param (id as an example here) I am unable to run encore with the following error.

$ encore run

  ❌ Building Encore application graph... Failed: parse path param types
Caused by:
    path param "id" not found
  ⠙ Analyzing service topology...
parse path param types

Caused by:
    path param "id" not found

I tracked the RawHandler type to here thinking there might be a place for me to add the params in but I don't see any there.

Minimal reproduction

Are there any paths I haven't explored here?

Thanks for the report! I've fixed this in #1227. Will issue a new release shortly. (Once live, you can access the path params via currentRequest() imported from the encore.dev module.)

(The fix is now live, with Encore v1.37.7.)