Skip to content

Commit

Permalink
fix: process.env not enumerable due to being a proxy (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-elicx authored Aug 28, 2023
1 parent 82dacc5 commit f764fff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-rules-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudflare/next-on-pages': patch
---

Fix `process.env` not being enumerable due to being a proxy.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export function generateGlobalJs(): string {
env: new Proxy(
{},
{
ownKeys: () => Reflect.ownKeys(envAsyncLocalStorage.getStore()),
getOwnPropertyDescriptor: (_, ...args) =>
Reflect.getOwnPropertyDescriptor(envAsyncLocalStorage.getStore(), ...args),
get: (_, property) => Reflect.get(envAsyncLocalStorage.getStore(), property),
set: (_, property, value) => Reflect.set(envAsyncLocalStorage.getStore(), property, value),
}),
Expand Down

0 comments on commit f764fff

Please sign in to comment.