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

History pushState doesn't trigger Interceptor Route #70886

Open
iamJoeTaylor opened this issue Oct 6, 2024 · 0 comments
Open

History pushState doesn't trigger Interceptor Route #70886

iamJoeTaylor opened this issue Oct 6, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.

Comments

@iamJoeTaylor
Copy link

Link to the code that reproduces this issue

https://github.com/iamJoeTaylor/next-intercept-route

To Reproduce

  1. Using my repro you can npm run dev in my-app
  2. Click on Open Modal with history which uses window.history.pushState

To build a reproduction yourself;

  1. New NextJS project with App router.
  2. Add an Interceptor Route
  3. use window.history.pushState

This blog mentions pushSate so I'd expect it to work. https://nextjs.org/blog/next-14-1#windowhistorypushstate-and-windowhistoryreplacestate

Current vs. Expected behavior

Currently the URL changes but the interceptor route is not invoked.

Expect the URL to change, the intercept route to work, and the history item to be present when fetched from window.history.state

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:36 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 20.9.0
  npm: 10.1.0
  Yarn: 1.22.19
  pnpm: 8.15.4
Relevant Packages:
  next: 14.2.14 // Latest available version is detected (14.2.14).
  eslint-config-next: 14.2.14
  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), Vercel (Deployed)

Additional context

No response

@iamJoeTaylor iamJoeTaylor added the bug Issue was opened via the bug report template. label Oct 6, 2024
@github-actions github-actions bot added the Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes. label Oct 6, 2024
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

1 participant