Skip to content

fix(client): render SharePage at bare #/s/:appId share URL - #3561

Open
greglum wants to merge 1 commit into
devfrom
fix-share-route-index
Open

fix(client): render SharePage at bare #/s/:appId share URL#3561
greglum wants to merge 1 commit into
devfrom
fix-share-route-index

Conversation

@greglum

@greglum greglum commented Aug 18, 2026

Copy link
Copy Markdown

Problem

Since #3549 (merged Aug 13), the URL copied by the Share App dialog — <base>#/s/<appId> — is broken: opening it renders ProjectLayout with an empty outlet and the shared app never appears. Users found that appending an extra segment (e.g. /portals) to the copied URL makes it work.

Cause

#3549 restructured the share route from a single leaf splat route to a nested one:

// before
<Route path="s/:appId/*" element={<SharePage />} />
// after
<Route path="s/:appId" element={<ProjectLayout />}>
    <Route path="*" element={<SharePage />} />
</Route>

In React Router 6, a nested path="*" child does not match the parent's bare path — an index route is required. Verified against the repo's react-router-dom@6.30.3 with matchRoutes:

  • /s/abc → matched only / > s/:appId (SharePage never rendered)
  • /s/abc/portals → matched / > s/:appId > * (which is why appending /portals "fixed" it)

Fix

Add an index child rendering the same SharePage:

<Route path="s/:appId" element={<ProjectLayout />}>
    <Route index element={<SharePage />} />
    <Route path="*" element={<SharePage />} />
</Route>

After the fix, matchRoutes resolves /s/abc, /s/abc/, and /s/abc/<anything> to SharePage. The copied URL itself was always correct, so no change to the Share dialog is needed. tsc --noEmit on packages/client reports an identical error profile before and after the change (all pre-existing).

PR #3549 nested the share route under ProjectLayout with only a splat
child. In React Router 6 a nested path="*" child does not match the
parent's bare path, so the exact URL copied by the Share App dialog
(#/s/<appId>) rendered ProjectLayout with an empty outlet and the shared
app never appeared; users could only work around it by appending an
extra segment such as /portals. Add an index route so SharePage renders
at the bare share URL again.
@greglum
greglum requested a review from a team as a code owner August 18, 2026 20:49
@snyk-io

snyk-io Bot commented Aug 18, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant