-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Issue: @typescript/vfs fails in Node.js 25 due to changes in Web Storage implementation. Node.js 25 enabled Web Storage by default, but the package assumes it's running in a browser environment and directly calls localStorage.getItem("DEBUG") without checking if localStorage is properly available. This causes a "localStorage.getItem is not a function" error when the Web Storage API is enabled but not fully implemented. The issue affects all packages that depend on @typescript/vfs, including twoslash, @shikijs/twoslash, fumadocs-twoslash, and fumadocs-mdx.
Here is an issue in fumadocs-mdx that is a direct result of this, failing dependent project's npm install due to a broken post-install script: fuma-nama/fumadocs#2456. To reproduce, simply create a Fumadocs project in Node.js 25 and observe the error. Alternatively:
Reproducible code
Environment:
Node.js 25.0.0
@typescript/vfs 1.6.1
Steps to reproduce:
- Install Node.js 25.0.0
- Create a new project with @typescript/vfs as a dependency
- Run any code that imports @typescript/vfs
You will see the error:
TypeError: localStorage.getItem is not a function
at Object. (/path/to/node_modules/@typescript/vfs/dist/vfs.cjs.development.js:25:64)