We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c964e94 commit 1843cf4Copy full SHA for 1843cf4
.changeset/famous-pillows-kiss.md
@@ -0,0 +1,5 @@
1
+---
2
+"@typescript/vfs": patch
3
4
+
5
+Modify localStorage check to prevent crashes in Node 25
packages/typescript-vfs/src/index.ts
@@ -23,7 +23,7 @@ try {
23
} catch (error) { }
24
25
const hasProcess = typeof process !== `undefined`
26
-const shouldDebug = (hasLocalStorage && localStorage!.getItem("DEBUG")) || (hasProcess && process.env.DEBUG)
+const shouldDebug = (hasLocalStorage && typeof localStorage!.getItem === 'function' && localStorage!.getItem("DEBUG")) || (hasProcess && process.env.DEBUG)
27
const debugLog = shouldDebug ? console.log : (_message?: any, ..._optionalParams: any[]) => ""
28
29
export interface VirtualTypeScriptEnvironment {
0 commit comments