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

"Intercepting routes" feature not working in production #63076

Open
478732 opened this issue Mar 9, 2024 · 3 comments
Open

"Intercepting routes" feature not working in production #63076

478732 opened this issue Mar 9, 2024 · 3 comments
Labels
bug Issue was opened via the bug report template.

Comments

@478732
Copy link

478732 commented Mar 9, 2024

Link to the code that reproduces this issue

https://github.com/478732/temp

To Reproduce

  1. Visit https://resplendent-halva-bdccd9.netlify.app/
  2. Click on the text, "Image 1"
  3. You will be taken to another page

Current vs. Expected behavior

Current behavior

  1. On https://resplendent-halva-bdccd9.netlify.app/
  2. When you click on the text, "Image 1"
  3. You will be taken to another page

Expected behavior

  1. On https://resplendent-halva-bdccd9.netlify.app/
  2. When you click on the text, "Image 1"
  3. Black box should appear

Description

I am trying to make a feature where

when you click on a specific element, a black box appears.

To make this feature, I am using the "intercepting routes" feature.

It works fine locally, but does not work in production.

Locally, on localhost:3000, when I click on the text "Image 1", a black box appears.

However, in production at https://resplendent-halva-bdccd9.netlify.app/

when I click on the text, "Image 1", I am taken to another page (unexpected)

A black box should be appearing.

My code is similar to vercel's nextgram app found at https://github.com/vercel/nextgram

Video showing problem

demo.mov

Provide environment information

- MacOS
- NextJS 14.1
- Google Chrome

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

Not sure

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

Other (Deployed)

Additional context

No response

@478732 478732 added the bug Issue was opened via the bug report template. label Mar 9, 2024
@478732 478732 changed the title "Intercepting routes" feature does not work in production "Intercepting routes" feature not working in production Mar 9, 2024
@CalebMacdonaldBlack
Copy link

It's an issue with netlify

netlify/next-runtime#2089

@DanhezCode
Copy link

I have the same problem in version 14.2.4 with a code very similar to this one, it works well in the development environment but in the production environment after doing the build it redirects me without showing the modal and it does it locally when using the start command instead of dev without deploying to any hosting

@DanhezCode
Copy link

After several hours of troubleshooting, I discovered the error. The solution lies in how the folder name was being declared for interception. I was using a folder named (.)/signin because I had interpreted that this was the correct way to set up the interception. However, the correct approach is to create a folder named (.) and within this folder, place another folder named signin.

The creator of this issue is making the same mistake I did. If they change (.)/photos/[id] to a folder named (.) and place the other folders inside it, in the respective order of photos and [id], it will work.

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.
Projects
None yet
Development

No branches or pull requests

3 participants