Skip to content
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

Property Context.Params does not exist #665

Closed
gabrielwbenatti opened this issue Jul 25, 2024 · 2 comments
Closed

Property Context.Params does not exist #665

gabrielwbenatti opened this issue Jul 25, 2024 · 2 comments
Labels
invalid This doesn't seem right

Comments

@gabrielwbenatti
Copy link

When I type "Context.Params" an exception raises with the message "Property 'params' does not exist on type 'Context<State, Record<string, any>>"

image

How to proceed? in version 15 it had "Helpers", but in 16 it doesn't have it and I don't know how it is required

I opened issue number #664 but I had no solution

@e-osuna-g
Copy link

yeah params attribute does not exist in Context like they said to you in #664
in this example

router.get("/static/:file", async (ctx) => {
  return await send(ctx, "./static/" + ctx.params.file);
});

i can use params that come from a router, is this what you are intending to do?
in this case params get added with the attribute file because it's what is being send in the route. why not send that param from the route to this helper function?

@kitsonk kitsonk added the invalid This doesn't seem right label Jul 27, 2024
@kitsonk
Copy link
Collaborator

kitsonk commented Jul 27, 2024

Just recreating an issue isn't helpful. It is still invalid. There is nothing wrong with oak, you are just using it wrong as explained in the other issue.

@kitsonk kitsonk closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants