kitbagjs / router

A type safe router for vuejs
MIT License
131 stars 1 forks source link

bug: external `to` on router-link was rendering NotFound before navigating #212

Closed stackoverfloweth closed 2 days ago

stackoverfloweth commented 3 days ago

Solution was to update click handler on underlying a tag, avoid pushing to router if route is external.

This solution is incomplete. A better solution will be moving this responsibility deeper into router. That would also prevent this bug if a developer calls router.push('https://router.kitbag.dev'). Currently the router-link compares the host of the resolved url against window.location.host. We probably shouldn't move that similar logic into the router since we can't guarantee the user isn't in a Node environment.

I will continue working towards a more complete solution. I'm considering, and welcome feedback on the following ideas:

netlify[bot] commented 3 days ago

Deploy Preview for kitbag-router ready!

Name Link
Latest commit 77ead93f1b71ad95de2f3a3bcc95d16f90b533a1
Latest deploy log https://app.netlify.com/sites/kitbag-router/deploys/6685f0359cdb1d00080cb2cb
Deploy Preview https://deploy-preview-212--kitbag-router.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.