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

[🐛 Bug]: Next.js app directory route interception doesn't work properly #310

Closed
1 task
bharatari opened this issue Jun 13, 2023 · 2 comments · Fixed by #312
Closed
1 task

[🐛 Bug]: Next.js app directory route interception doesn't work properly #310

bharatari opened this issue Jun 13, 2023 · 2 comments · Fixed by #312
Labels
bug Something isn't working

Comments

@bharatari
Copy link

next-on-pages environment related information

System:
Platform: linux
Arch: x64
Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
Memory: 8 GB
Shell: /bin/bash
Binaries:
Node: 18.15.0
Yarn: 1.22.19
npm: 9.5.0
pnpm: 8.3.1
Package Manager Used: npm
Relevant Packages:
@cloudflare/next-on-pages: 1.0.2
vercel: [object Promise]
next: [object Promise]

Description

Route interception as described in the Next.js docs here doesn't seem to work properly with next-on-pages. Parallel routes do work, it's just route interception (directories with (.), (..), (...) prefixes) that don't work.

Reproduction

Here is a minimal repro of the issue: https://github.com/bharatari/route-interception.

next dev
Route /
Screenshot 2023-06-13 103657
Route /hello after clicking the button (which is a Link to /hello). Note that interception happens as expected here, the modal is shown instead of rendering the actual /hello route.
Screenshot 2023-06-13 103721
Route /hello when loading the URL directly. This is the case with no interception, the actual route is rendered.
Screenshot 2023-06-13 103737

wrangler
Route /
Screenshot 2023-06-13 104034
Route /hello after clicking the button (which is a Link to /hello). The /hello route is loaded, interception does not work as expected here.
Screenshot 2023-06-13 104100
Route /hello when loading the URL directly. This is the case with no interception.
Screenshot 2023-06-13 104047

When run with wrangler, intercepted routes as defined in the app directory are completely ignored. The actual route is rendered every time.

Pages Deployment Method

None

Pages Deployment ID

No response

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
@james-elicx
Copy link
Contributor

Thank you for opening this issue and providing a reproduction 🙂

I believe I have identified the cause and have opened a PR that should fix this issue. I would welcome you to try out the prerelease available in #312 (comment).

@bharatari
Copy link
Author

Hi @james-elicx, the prerelease is working great. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants