Skip to content

Conversation

@ph1p
Copy link

@ph1p ph1p commented Jan 7, 2026

When a Next.js app uses a basePath (e.g., /dashboard) the proxy.js did not load and shows a 404.
Now its fixed.

@ph1p ph1p changed the title Add basePath option Add basePath flag Jan 7, 2026
@adriaandotcom
Copy link
Collaborator

Thanks a lot!

Is basePath always set up? Aka, do we need a fallback for any version?

@ph1p
Copy link
Author

ph1p commented Jan 8, 2026

All previous versions should work without changes. The default value of rewrites.basePath is true. The problem occurs with the tag <Script src="/proxy.js"/>. If we define a basePath (e.g., /dashboard), the proxy.js file cannot be found because the path would now have to be /dashboard/proxy.js. To prevent this, we simply set rewrites.basePath to false when a basePath is specified.

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