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

routeParams did not pass on the client-side by default #104

Closed
zhy0216 opened this issue Apr 15, 2024 · 4 comments
Closed

routeParams did not pass on the client-side by default #104

zhy0216 opened this issue Apr 15, 2024 · 4 comments
Labels
bug 💥 Something isn't working

Comments

@zhy0216
Copy link

zhy0216 commented Apr 15, 2024

on doc it mentioned it should: https://vike.dev/passToClient#default

@brillout
Copy link
Member

Indeed it should.

I cannot reproduce. Can you publish a minimal reproduction? I'll re-open then.

@brillout brillout closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@zhy0216
Copy link
Author

zhy0216 commented Apr 16, 2024

Hi @brillout, if you can go to minimal example in this repo, and use pageContext.routeParams in the +Page. Then open dev tool in browser then you can see the following errors.
Screenshot 2024-04-16 at 16 14 55

@brillout brillout added the bug 💥 Something isn't working label Apr 17, 2024
@brillout
Copy link
Member

It's because the page doesn't have any route parameters. That said, the error is misleading and should be improved. Labeling this as bug.

@brillout
Copy link
Member

pageContext.routeParams is now always passed regardless of whether the page has a route parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💥 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants