Skip to content

Fix: ui- rendering issue on Pr-preview link#7642

Merged
CodexRaunak merged 3 commits intolayer5io:masterfrom
saurabhraghuvanshii:Pr
Apr 20, 2026
Merged

Fix: ui- rendering issue on Pr-preview link#7642
CodexRaunak merged 3 commits intolayer5io:masterfrom
saurabhraghuvanshii:Pr

Conversation

@saurabhraghuvanshii
Copy link
Copy Markdown
Member

Description

gatsby-config.js

  • In CI, the workflow sets PATH_PREFIX to the folder segment where the preview will live (e.g. pr-preview/pr-5).
  • Gatsby reads pathPrefix: the leading / turns that into a path such as /pr-preview/pr-5.
  • With npm run build:preview (gatsby build --prefix-paths), Gatsby rewrites asset and page links so they start with that prefix (e.g. /pr-preview/pr-5/app-….js).
  • pathPrefix is only set when PATH_PREFIX is set, so a normal production build (no env var) stays a root deploy and is unchanged.

the workflow make the build which subpath the preview uses; gatsby-config.js applies that as pathPrefix so every script and style loads from the right place and the page can run as a full interactive app.

This PR fixes #

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2026-04-20 16:16 UTC

@CodexRaunak CodexRaunak merged commit fdb1757 into layer5io:master Apr 20, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants