Skip to content

Preview basePath misses pr- prefix → unstyled preview pages #23

@kaankacar

Description

@kaankacar

PR preview pages render but show up unstyled because preview-pr.yml builds Next.js with NEXT_BASE_PATH=/pr/<N> while rossjrw/pr-preview-action actually deploys to /pr/pr-<N>/ (its umbrella-dir adds a pr- prefix), so every asset URL baked into the HTML 404s.

Reproduce: open any preview (e.g. https://skills.stellar.org/pr/pr-22/) — HTML loads, but CSS/JS requests to /pr/22/_next/... return 404; the same files exist at /pr/pr-22/_next/....

Fix: add pr- to the basePath line in .github/workflows/preview-pr.yml (around line 85):

# before
echo "NEXT_BASE_PATH=${base}/pr/${{ github.event.number }}" >> "$GITHUB_ENV"

# after
echo "NEXT_BASE_PATH=${base}/pr/pr-${{ github.event.number }}" >> "$GITHUB_ENV"

The fix touches only preview-pr.yml, which runs on pull_request events. Production (deploy-pages.yml) is independent and unaffected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions