-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Labels
Description
Describe the bug
Calling redirect on page load results in the target route being added twice to the URL.
Example:
- I have two pages
Homewhich lives at/and simply returnsredirect("/target");Targetwhich lives at/targetand returns<div>Target</div>;
Expected behaviour (and the behaviour I see when running via npm run dev):
Loading the / route takes me to /target
Observed behaviour:
Loading the / route takes me to /target,/target
Steps to reproduce
- Create two pages
Homewhich lives at/and simply returnsredirect("/target");Targetwhich lives at/targetand returns<div>Target</div>;
Now load the / route and notice that it takes you to /target,/target.
Expected behavior
Redirecting on page load takes me to the target page.
Keeping with our example, this means:
Loading the / route takes me to /target
@opennextjs/cloudflare version
1.7.1
Wrangler version
4.34.0
next info output
Using vars defined in .dev.vars
/bin/sh: yarn: command not found
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:55 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6031
Available memory (MB): 36864
Available CPU cores: 14
Binaries:
Node: 22.13.1
npm: 11.1.0
Yarn: N/A
pnpm: 9.15.1
Relevant Packages:
next: 15.4.6 // There is a newer version (15.5.2) available, upgrade recommended!
eslint-config-next: 15.4.6
react: 19.1.0
react-dom: 19.1.0
typescript: 5.9.2
Next.js Config:
output: N/A
⚠ There is a newer version (15.5.2) available, upgrade recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issueAdditional context
No response
avernikoz and yoohahn