Skip to content

Commit 26b13af

Browse files
pomfridaclaude
andcommitted
fix(eds-utils): use globalThis for process access without @types/node
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2ba6c15 commit 26b13af

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

packages/eds-utils/src/hooks/useDeprecationWarning.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { useEffect, useRef } from 'react'
22

3-
declare const process: { env?: { NODE_ENV?: string } } | undefined
4-
53
/**
64
* Hook that displays a deprecation warning in the console during development.
75
* The warning is only shown once per component instance and only in development mode.
@@ -32,10 +30,8 @@ export const useDeprecationWarning = (
3230
let isDevelopment = false
3331

3432
// Check Node.js environment (for tests and SSR)
35-
if (
36-
typeof process !== 'undefined' &&
37-
process.env?.NODE_ENV === 'development'
38-
) {
33+
const g = globalThis as { process?: { env?: { NODE_ENV?: string } } }
34+
if (g.process?.env?.NODE_ENV === 'development') {
3935
isDevelopment = true
4036
}
4137

0 commit comments

Comments
 (0)