fix: router links breaking on canvas#164
Merged
ruchamahabal merged 2 commits intofrappe:developfrom Apr 15, 2026
Merged
Conversation
- app routes are not in the context of studio router so route resolution errors should not stop the component from rendering
- This ensures router-link renders correctly for the app being edited in studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
<router-link>inside components like Breadcrumbs fails because the Studio editor's Vue router doesn't have the app's routes registered. When router-link tries to resolve a route like{ name: "Campaigns" }where Campaigns is an app page, it throws "No match for..." error, and the component does not render.This only breaks for named routes ({ name: "Campaigns" }) not path routes ("/campaigns") because vue router's useLink tries to resolve named routes passed to it even before rendering the component.
But this will always be the case because studio's router would not resolve routes for the app that's being edited in edit mode
Fix 1:
Catch & ignore router errors in Studio Component renderer. App routes are not in the context of studio router so route resolution errors should not stop the component from rendering.
This only renders the path routes, not the named routes (that are invalid)
Fix 2:
patch router.resolve to resolve unmatched routes to the "Not Found" page. This ensures router-link renders correctly for the app being edited in studio
Why patch router.resolve and not use beforeResolve hook instead?
The issue is that resolves the route during its setup (when it calls useLink()), which happens before any navigation occurs.
beforeResolveruns only on actual navigation, not when router-link resolves.