vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.
https://vike.dev
MIT License
4.39k stars 353 forks source link

All `+route` are triggered #1858

Closed rtritto closed 2 months ago

rtritto commented 2 months ago

Description

When you navigate on a page, all route hooks are triggered.

Reproduction

  1. git clone https://github.com/rtritto/template-vike-solid-daisyui.git
  2. cd template-vike-solid-daisyui
  3. git checkout bug-trigger-route
  4. yarn
  5. yarn dev
  6. Navigate to http://localhost:3000
  7. Check logs:

    route testroute1
    route testroute2
brillout commented 2 months ago

https://vike.dev/route-function#lightweight-fast

rtritto commented 2 months ago

Using filesystem routing, where can I validate route parameters?

Edit: I used validation in +data hook

brillout commented 2 months ago

https://brillout.github.io/rules#try