Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next 14 - redirect(<path>) does not work at all inside intercepting routes #58661

Closed
1 task done
sannajammeh opened this issue Nov 20, 2023 · 3 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template. locked Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@sannajammeh
Copy link
Contributor

Link to the code that reproduces this issue

https://github.com/sannajammeh/next-intercepting-noredirect

To Reproduce

  1. Install deps with Bun
  2. bun run dev
  3. Navigate to /sites
  4. Press create a new site anchor tag
  5. Observe route is intercepted correctly at /sites/new
  6. Add any text and press Submit
  7. Observe nothing happens, form submits fine but redirect call will not do navigate back to /sites
  8. Now set browser url to http://localhost:3000/sites/new to load standalone page
  9. Repeat step 6 and observe everything work.

Current vs. Expected behavior

Current:

redirect() called inside server action will never fire on an intercepting route. Redirect works as usual on normal routes. This happens both in next dev & next start

Expected:

redirect() should work on both normal and intercepted route.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103
Binaries:
  Node: 21.0.0
  npm: 10.2.0
  Yarn: 1.22.11
  pnpm: 8.10.5
Relevant Packages:
  next: 14.0.4-canary.5
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

App Router, Routing (next/router, next/navigation, next/link)

Additional context

I have tested this on both Next 13, 14 (current) and 14 (canary). All yield the same bug.

@sannajammeh sannajammeh added the bug Issue was opened via the bug report template. label Nov 20, 2023
@github-actions github-actions bot added the Navigation Related to Next.js linking (e.g., <Link>) and navigation. label Nov 20, 2023
@pekarja5
Copy link
Contributor

Seems like duplicate of #57665

@balazsorban44
Copy link
Member

Closing as duplicate of #57665

Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

3 participants