vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.88k stars 26.66k forks source link

null is not an object (evaluating 't.parallelRoutes.get') #67730

Open JClackett opened 2 months ago

JClackett commented 2 months ago

Link to the code that reproduces this issue

https://github.com/JClackett/next-reproduction-app

To Reproduce

So, I literally have no idea how to reproduce this consistently yet, but will keep trying.

I'm getting this error semi-often in production only and only sometimes for certain users, most of the time it's working.

Looking at the stack trace (which is limited), it's due to some call to a <cache>.parallelRoutes.get. Searching the next code base with https://github.com/search?q=repo%3Avercel%2Fnext.js%20parallelRoutes.get&type=code shows all the times this method is called.

It seems that one of the cache objects is null for me? How would I go about creating a repro for that. Or does anyone have any idea why this cache object would be null in the first place. The page this is erroring on is nothing special, it's just a async server component that fetches data and renders few components, one being a client component, so I dont see (yet) how this is something strange with my setup. Only thing of note is that im using react suspense to handle the fallback because the loading.tsx pages dont work as id like (they dont trigger on search param changes).

Current vs. Expected behavior

Doesn't crash

Provide environment information

Like I said, only in production and on vercel.
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 8
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.15.7
Relevant Packages:
  next: 14.2.5 // Latest available version is detected (14.2.5).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.3
Next.js Config:
  output: N/A

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

Navigation, Runtime

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

Vercel (Deployed)

Additional context

Only in production on vercel

JClackett commented 2 months ago

At the same time as this error I get the: "async/await is not yet supported in Client Components, only Server Components." error from React (https://react.dev/errors/482).

But im not using async client components, im using async in a server component as shown in the repro. But is there some caveats to that that im not aware of? I am calling a server action from the client component that renders.

But the next.js error is always coupled with this react error, so maybe theres a connection?

JClackett commented 2 months ago

Looking into the breadcrumbs of what the user did, its not on navigating to the page, its when they submit the server action, but they did it 3 times successfully and then on the 4th time it caused these errors.

JClackett commented 2 weeks ago
Screenshot 2024-08-26 at 15 24 36

Still getting this when certain users call a server action

mordechaim commented 2 days ago

Yes, this keeps happening to me as well.

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!