generateStaticParams globalThis (global) singleton problem #69042
Labels
bug
Issue was opened via the bug report template.
Performance
Anything with regards to Next.js performance.
Runtime
Related to Node.js or Edge Runtime with Next.js.
Link to the code that reproduces this issue
https://github.com/vaneenige/next-app-router-singleton
To Reproduce
Current vs. Expected behavior
I expected the global object to be the same in this environment
Provide environment information
Which area(s) are affected? (Select all that apply)
Performance, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
For example, I declare a new key in the global object using instrumentation.ts (it doesn't really matter where you do it)
When I try to get it inside the generateStaticParams function, I get undefined
But after trying the same thing in the component, I got the expected result:
I found similar issues and they seem to be related:
#65350
#52165
It seems to be running in a separate environment. But how can I solve this problem?
The text was updated successfully, but these errors were encountered: