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

Could not find the module in the React Client Manifest. This is probably a bug in the React Server Components bundler. #52862

Closed
1 task done
gauravsaini964 opened this issue Jul 19, 2023 · 17 comments · Fixed by #52961
Labels
bug Issue was opened via the bug report template. please add a complete reproduction The issue lacks information for further investigation

Comments

@gauravsaini964
Copy link

gauravsaini964 commented Jul 19, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103
    Binaries:
      Node: 16.20.0
      npm: 8.19.4
      Yarn: 1.22.19
      pnpm: 8.6.0
    Relevant Packages:
      next: 13.4.11-canary.0
      eslint-config-next: 13.4.8
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/vercel/next.js/assets/16620277/58d05257-6176-47bb-bca5-b84afb6c5843

To Reproduce

https://stackblitz.com/github/easydevgit/next-13-course/tree/master/advanced-routing-intercepting-routes?file=app/layout.tsx

Describe the Bug

Screenshot 2023-07-19 at 3 46 47 PM Screenshot 2023-07-19 at 3 54 29 PM

I am getting this error after updating to 13.4.10 and also on latest canary. It is working fine on 13.4.9.
I am using parallel and intercepting routes.

Expected Behavior

Normal parallel and intercepting route behaviour.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

@gauravsaini964 gauravsaini964 added the bug Issue was opened via the bug report template. label Jul 19, 2023
@gauravsaini964
Copy link
Author

@timneutkens @khuezy Opened new issue as earlier one was locked #50243

@timneutkens
Copy link
Member

timneutkens commented Jul 19, 2023

I'm amazed by how my comments and the issue template are ignored multiple times 😢 This issue does not have a reproduction, only a link to a directory tree screenshot.

@timneutkens timneutkens added the please add a complete reproduction The issue lacks information for further investigation label Jul 19, 2023
@github-actions
Copy link
Contributor

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the please add a complete reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template for pages, template for App Router), but you can also use these templates: CodeSandbox: pages or CodeSandbox: App Router.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Next.js (next@canary) to make sure your issue has not already been fixed.

If you cannot create a clean reproduction, another way you can help the maintainers' job is to pinpoint the canary version of next that introduced the issue. Check out our releases, and try to find the first canary release that introduced the issue. This will help us narrow down the scope of the issue, and possibly point to the PR/code change that introduced it. You can install a specific version of next by running npm install next@<version>.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the please add a complete reproduction label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the 👍 reaction on the topmost comment (please do not comment "I have the same issue" without reproduction steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

@gauravsaini964
Copy link
Author

I'm amazed by how my comments and the issue template are ignored multiple times 😢 This issue does not have a reproduction, only a link to a directory tree screenshot.

I must have missed it.

Its not mine but having the exact same issue.

https://stackblitz.com/github/easydevgit/next-13-course/tree/master/advanced-routing-intercepting-routes?file=app/layout.tsx

@khuezy
Copy link
Contributor

khuezy commented Jul 19, 2023

@timneutkens please forgive our incompetence ;)
But in the stackblitz above, the model interception of (.)login causes the app to crash when it tries to intercept the route.

@collection27
Copy link

Here is a simple way to reproduce this issue:

  1. Clone https://github.com/vercel-labs/nextgram/tree/main
  2. Update to next@latest (13.4.10)
  3. Run

Anytime you click a photo the error will popup.

Error: Could not find the module "X:\gits\testerror\nextgram\src\components\modal\Modal.tsx#" in the React Client Manifest. This is probably a bug in the React Server Components bundler.

@isaackoz
Copy link

I believe #52664 is causing the issue. The issue appears to be due to the naming convention of intercepting routes.

Line 352 in packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts

const groupName = entryName
        .slice(0, entryName.lastIndexOf('/'))
        .replace(/\/@[^/]+/g, '')
        .replace(/\/\([^/]+\)/g, '')

If we do a normal group,

const route1 = "app/(group)/@named/foo/page.tsx"

const groupName = route1
        .slice(0, route1.lastIndexOf('/'))
        .replace(/\/@[^/]+/g, '')
        .replace(/\/\([^/]+\)/g, '')

console.log(groupName)
// output: 'app/foo' (correct syntax)

However if we do an intercepting route,

const route2 = "app/(group)/@named/(.)foo/page.tsx"

const groupName = route2
        .slice(0, route2.lastIndexOf('/'))
        .replace(/\/@[^/]+/g, '')
        .replace(/\/\([^/]+\)/g, '')

console.log(groupName)
// output: 'appfoo' <----- Missing '/'

I'm not sure if it handles intercepting routes above or elsewhere, but this just caught my eye at first glance. It would make sense why intercepting routes don't work.

@khuezy
Copy link
Contributor

khuezy commented Jul 19, 2023

So did the PR above forget to account for the (.) and (..) characters? And with the (..) paths, it would need to resolve the paths.
I tried doing a "(..)(..)(..)" path to see if nextjs would properly walk up the tree but it throws an error. The implementation doesn't seem robust, since this is probably at least the 5th issue regarding route interception/modals.

@devrudraa
Copy link

devrudraa commented Jul 20, 2023

I am facing the same problem I made a modal using parallel routing and intercepting route it works fine but when I added a back button using useRouter from "next/navigation" it is giving me error:

Unhandled Runtime Error
Error: Could not find the module "[absolute path]\app@modal(.)password\new\page.jsx#" in the React Client Manifest. This is probably a bug in the React Server Components bundler.

Please help me I need to add this back function 🥹

Edited:
I check it once again and found out that this error doesn't occur when I used useRouter but when I added "use client";

@jmcpeak
Copy link

jmcpeak commented Jul 20, 2023

Thank you @isaackoz! Nice job tracking it down in vercel's source!

@vercel - issue was found - any possibility of getting this resolved in your next point release?

@kodiakhq kodiakhq bot closed this as completed in #52961 Jul 20, 2023
kodiakhq bot pushed a commit that referenced this issue Jul 20, 2023
We have the logic to group the client compiler's entry names to make sure we generate one single manifest file for the page. This is complicated and requires a special step to "group" the entry names because a page can depend on a bunch of files from everywhere.

And currently, the normalization of "entryName → groupName" doesn't cover interception routes' conventions (`(.)`, `(..)` and `(...)`). This PR fixes that.

Closes #52862, closes #52681, closes #52958.
@shuding
Copy link
Member

shuding commented Jul 21, 2023

Hi all, this issue should be fixed in 13.4.11. Please upgrade and let us know, thanks!

@khuezy
Copy link
Contributor

khuezy commented Jul 21, 2023

Thanks @shuding, it's fixed!

@khuezy
Copy link
Contributor

khuezy commented Jul 26, 2023

uh oh, .13 broke this again, cc @shuding

@NitrousBGC
Copy link

Broken for me too ! :/

@timneutkens
Copy link
Member

Please open a new issue with a reproduction so that we can have a look.

@EranNL
Copy link

EranNL commented Aug 6, 2023

I get this error when nested components both have use client defined. I don't know whether that is related, but it is perhaps worth noting.

@timneutkens
Copy link
Member

#52862 (comment)

@vercel vercel locked as off-topic and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. please add a complete reproduction The issue lacks information for further investigation
Projects
None yet
10 participants