You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the reproduction, run yarn and yarn dev and open http://localhost:3000/ will pop the following error
Error [ReferenceError]: myvar is not defined
If you change next version to 13.4.12, it works
Describe the Bug
In a larger code, I use a global variable (here global.myvar) defined when the custom server starts, in order to start my database, and store a function. I use this function in the server-side to perform queries and stop the database when I stop the server.
It worked like a charm until next 13.4.12.
Since next 13.4.13, the global variable is not available in the server side.
Expected Behavior
Same behavior of next 13.4.12
Which browser are you using? (if relevant)
Chrome 115.0.5790.170
How are you deploying your application? (if relevant)
custom server
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 Binaries: Node: 16.20.0 npm: 8.19.4 Yarn: 1.22.19 pnpm: 8.5.0 Relevant Packages: next: 13.4.20-canary.2 eslint-config-next: 13.4.19 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/Airthium/next-global
To Reproduce
Using the reproduction, run
yarn
andyarn dev
and openhttp://localhost:3000/
will pop the following errorIf you change
next
version to13.4.12
, it worksDescribe the Bug
In a larger code, I use a global variable (here
global.myvar
) defined when the custom server starts, in order to start my database, and store a function. I use this function in the server-side to perform queries and stop the database when I stop the server.It worked like a charm until
next
13.4.12.Since
next
13.4.13, the global variable is not available in the server side.Expected Behavior
Same behavior of
next
13.4.12Which browser are you using? (if relevant)
Chrome 115.0.5790.170
How are you deploying your application? (if relevant)
custom server
The text was updated successfully, but these errors were encountered: