Skip to content

fix(infra): apply PUBLIC_URL to base and basename (#1568) - #2304

Open
alfonsodg wants to merge 1 commit into
OpenSignLabs:stagingfrom
alfonsodg:pr/1568-public-url
Open

alfonsodg wants to merge 1 commit into
OpenSignLabs:stagingfrom
alfonsodg:pr/1568-public-url

Conversation

@alfonsodg

Copy link
Copy Markdown

Problem

PUBLIC_URL was defined in the environment but never applied. Deployments
under a sub-path served assets and client-side routes from the wrong base.

Affected files

  • apps/OpenSign/vite.config.js
  • apps/OpenSign/src/App.jsx

Fix

PUBLIC_URL now drives the Vite base option and the router basename, so
assets and routes are resolved relative to the public path.

Acceptance criteria

  • A sub-path deployment loads its assets and routes correctly
  • A root deployment is unchanged

Copilot AI balanced review requested due to automatic review settings October 21, 2026 22:39
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@alfonsodg is attempting to deploy a commit to the prafull 's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Browser configuration and signing-route parsing still prevent sub-path deployments from working correctly.

2 open issues
What changed in this PR

This PR aims to support sub-path deployments by applying PUBLIC_URL to Vite’s asset base and React Router’s basename while preserving root deployments.

Changes:

  • Normalize PUBLIC_URL into Vite’s base path.
  • Derive the router basename from browser-accessible environment values.
File Description
apps/​OpenSign/​vite.config.js Normalize PUBLIC_URL and configure the asset base.
apps/​OpenSign/​src/​App.jsx Add environment lookup and router basename handling.

Review effort: Balanced

Comment thread apps/OpenSign/src/App.jsx
<AppLoader />
) : (
<BrowserRouter>
<BrowserRouter basename={(() => {
Comment thread apps/OpenSign/src/App.jsx Outdated
<BrowserRouter>
<BrowserRouter basename={(() => {
try {
const raw = getEnv()?.PUBLIC_URL || process.env.PUBLIC_URL;
@alfonsodg alfonsodg changed the title fix(infra): apply PUBLIC_URL to the asset base and the router basename (#1568) fix(infra): apply PUBLIC_URL to base and basename (#1568) Oct 22, 2026
Fixes OpenSignLabs#1568

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>

This branch has not been deployed

No deployments
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.

2 participants