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

Dynamic Modal Interception is Greedy #70651

Open
khuezy opened this issue Sep 30, 2024 · 1 comment
Open

Dynamic Modal Interception is Greedy #70651

khuezy opened this issue Sep 30, 2024 · 1 comment
Labels
bug Issue was opened via the bug report template. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.

Comments

@khuezy
Copy link
Contributor

khuezy commented Sep 30, 2024

Link to the code that reproduces this issue

https://github.com/khuezy/next-modal-bug

To Reproduce

  1. npm install
  2. npm run dev
  3. Go to localhost:3000/gallery
  4. Click on /gallery/dynamic
  5. See dynamic route modal interception
  6. Go back
  7. Click /gallery/static
  8. See that the static route is intercepted when it shouldn't

Current vs. Expected behavior

Modal Interception intercepts static routes as dynamic.

/app
  /gallery
    /[dynamic]
      page.tsx
    /static
      page.tsx
    /@modal
      /[dynamic]
        page.tsx

When linking to /gallery/static, the modal interceptor intercepts it as /gallery/[dynamic].

Without "@modal", the /gallery/static is processed before the /gallery/[dynamic] route. But with "@modal" interception, it is intercepting the /gallery/static path as [dynamic]

So with that, the expectation of "@modal" route interception is the same. "@modal" should not intercept

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: 22.6.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.7.0
Relevant Packages:
  next: 15.0.0-canary.173 // Latest available version is detected (15.0.0-canary.173).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.6.2
Next.js Config:
  output: N/A

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

Parallel & Intercepting Routes

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

next dev (local)

Additional context

No response

@khuezy khuezy added the bug Issue was opened via the bug report template. label Sep 30, 2024
@github-actions github-actions bot added the Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes. label Sep 30, 2024
@abhi12299
Copy link
Contributor

Does this only happen during next dev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.
Projects
None yet
Development

No branches or pull requests

2 participants