Skip to content

chore(vercel): use absolute hrefs in preview dir indexes#31106

Merged
ShaneK merged 1 commit into
mainfrom
fix/vercel-preview-links
Apr 30, 2026
Merged

chore(vercel): use absolute hrefs in preview dir indexes#31106
ShaneK merged 1 commit into
mainfrom
fix/vercel-preview-links

Conversation

@ShaneK

@ShaneK ShaneK commented Apr 30, 2026

Copy link
Copy Markdown
Member

Issue number: internal


What is the current behavior?

generate_dir_index in core/scripts/vercel-build.sh writes child links like <a href="basic/"> and an up-link <a href="../">. Vercel doesn't 308-redirect to add a trailing slash, so visiting a preview directory URL like /src/components/progress-bar/test (no slash) returns the index page but the browser resolves basic/ against the parent directory. That path doesn't exist, and Vercel's fallback serves the root landing page, so navigation looks like it "circles back" to the preview home instead of opening the test scenario.

What is the new behavior?

The dir-index generator now emits absolute hrefs based on the directory's url_path, including the ../ up-link. Trailing-slash quirks no longer affect navigation between component test scenarios on Vercel previews.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Test page:

Versus the broken version on main:

@ShaneK ShaneK requested a review from a team as a code owner April 30, 2026 16:16
@ShaneK ShaneK requested a review from BenOsodrac April 30, 2026 16:16
@vercel

vercel Bot commented Apr 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Apr 30, 2026 4:19pm

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Apr 30, 2026
@ShaneK ShaneK changed the title fix(vercel): use absolute hrefs in preview dir indexes chore(vercel): use absolute hrefs in preview dir indexes Apr 30, 2026

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneK ShaneK enabled auto-merge April 30, 2026 16:21
@ShaneK ShaneK added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit f897702 Apr 30, 2026
54 checks passed
@ShaneK ShaneK deleted the fix/vercel-preview-links branch April 30, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants