Cannot rewrite to external URL when basePath option is defined in next.config.js contains a hyphen #74431
Labels
bug
Issue was opened via the bug report template.
Developer Experience
Issues related to Next.js logs, Error overlay, etc.
Internationalization (i18n)
Related to Internationalization with Next.js.
Middleware
Related to Next.js Middleware.
Runtime
Related to Node.js or Edge Runtime with Next.js.
Link to the code that reproduces this issue
https://github.com/massaynus/next-rewrite-issue
To Reproduce
http://localhost:3000/mj-builder
Current vs. Expected behavior
if the
basePath
in next.config.mjs is set to/app
for example it works fine, it should be the same forbasePaths
with a hyphen in them like the valuemj-builder
showin in the example repoProvide environment information
/bin/sh: 1: yarn: not found /bin/sh: 1: pnpm: not found Operating System: Platform: linux Arch: x64 Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 Available memory (MB): 31943 Available CPU cores: 20 Binaries: Node: 20.17.0 npm: 11.0.0 Yarn: N/A pnpm: N/A Relevant Packages: next: 15.1.3 // Latest available version is detected (15.1.3). eslint-config-next: 15.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.7.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Developer Experience, Internationalization (i18n), Middleware, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Other (Deployed)
Additional context
first discovered the issue on v15.1.0 then tested on v15.1.3 and also canary to confirm the issue.
issue is reproducible everywhere it seems!
The text was updated successfully, but these errors were encountered: