diff --git a/.changeset/unlucky-shrimps-laugh.md b/.changeset/unlucky-shrimps-laugh.md new file mode 100644 index 0000000..3fcae65 --- /dev/null +++ b/.changeset/unlucky-shrimps-laugh.md @@ -0,0 +1,5 @@ +--- +'cf-bindings-proxy': patch +--- + +Check process is not undefined when checking whether to use the binding or not. diff --git a/src/index.ts b/src/index.ts index 1130167..47fdcae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,8 +11,9 @@ import { createBindingProxy } from './proxy'; * `true`. * */ export const isProxyEnabled = () => - process?.env?.ENABLE_BINDINGS_PROXY || - (!process?.env?.DISABLE_BINDINGS_PROXY && process?.env?.NODE_ENV === 'development'); + typeof process !== 'undefined' && + (process?.env?.ENABLE_BINDINGS_PROXY || + (!process?.env?.DISABLE_BINDINGS_PROXY && process?.env?.NODE_ENV === 'development')); /** * Interfaces with a binding from the environment.