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

Docs’ recommended modal handling approach interferes with soft navigation 404 behavior #75251

Open
ljuborados opened this issue Jan 23, 2025 · 0 comments
Labels
Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.

Comments

@ljuborados
Copy link

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/amazing-tharp-23mwdj

To Reproduce

  1. Start app in dev
  2. Click go to nonexistent route - notice the page hasn't changed
  3. Hit refresh for a hard-navigation - notice 404 gets rendered

Current vs. Expected behavior

Current

Adding a catch-all route into a slot to handle closing modals (as per the docs) breaks soft navigation to non-existent pages - Next just happily swallows the navigation, and keeps rendering the previous page.
NOTE: Hard navigation works as expected - renders a not found page.

Expected

If nothing - consistent behaviour between soft and hard navigation.
Ideally - either update docs with the correct approach of closing modals or fix the soft navigation.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.22
  pnpm: 9.9.0
Relevant Packages:
  next: 15.1.6 // Latest available version is detected (15.1.6).
  eslint-config-next: 15.1.3
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: standalone

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

Parallel & Intercepting Routes

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

next dev (local), next build (local), next start (local), Other (Deployed)

Additional context

No response

@github-actions github-actions bot added the Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes. label Jan 23, 2025
@ljuborados ljuborados changed the title Using the recommended approach from docs to handle modals breaks client-side not found handling Using the recommended approach from docs to handle modals breaks soft navigation 404 handling Jan 24, 2025
@ljuborados ljuborados changed the title Using the recommended approach from docs to handle modals breaks soft navigation 404 handling Docs’ recommended modal handling approach interferes with soft navigation 404 behavior Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.
Projects
None yet
Development

No branches or pull requests

1 participant