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
When a project depends on packages (like @trpc/client, for example) that reference the global variable and in the adapter-vercel config you pass the edge: true prop, throws a runtime error when a render is hit saying: global is not defined.
Reproduction
Try to deploy to vercel targeting edge functions instead of lamdba a project that imports a lib that reference the nodejs global variable like @trpc/client at any serverside point, like +layout.server.js or +layout.js, and the app should crash.
I will make a PR providing a fix for this bug in a late.
The text was updated successfully, but these errors were encountered:
juanvillacortac
changed the title
**Adapter Vercel**: global is not defined when build for edge network
*Adapter Vercel*: global is not defined when build for edge network
Aug 30, 2022
juanvillacortac
changed the title
*Adapter Vercel*: global is not defined when build for edge network
Adapter Vercel: global is not defined when build for edge network
Aug 30, 2022
To be clear, this is a bug in @trpc/client — unless it's only intended to be used in Node, then it shouldn't be referencing global (and even if it is only intended to be used in Node, globalThis is preferable and has been for a long time), so I would recommend opening an issue on that repo.
Describe the bug
When a project depends on packages (like
@trpc/client
, for example) that reference theglobal
variable and in theadapter-vercel
config you pass theedge: true
prop, throws a runtime error when a render is hit saying:global is not defined
.Reproduction
Try to deploy to vercel targeting edge functions instead of lamdba a project that imports a lib that reference the nodejs
global
variable like@trpc/client
at any serverside point, like+layout.server.js
or+layout.js
, and the app should crash.Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
I will make a PR providing a fix for this bug in a late.
The text was updated successfully, but these errors were encountered: