Skip to content

Backport the storage.js isBrowser guard to 0.2.x (Node 25+ localStorage ExperimentalWarning) #146

Closed

Description

@Gonic0

On Node.js 25+, reading the global localStorage without --localstorage-file emits a warning:

ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.

storage.js reads it when the module loads, so every Node process that imports lib0 0.2.x prints the warning once. That includes everything that uses yjs 13. Serverless platforms log stderr as errors, so the warning appears as an error on every cold start.

main (1.0.0-rc) already fixes this: src/storage.js checks isBrowser first (f8427b1). The released yjs versions, 13.6.x and the 14 prereleases, still depend on lib0 ^0.2.x, and 0.2.119 still has the old check.

Would you consider backporting that guard to a 0.2.x release?

Repro (lib0 0.2.119, Node 26.7.0): node --trace-warnings -e "import('lib0/storage')". The stack trace points to storage.js:43.

Activity

  1. added a commit that references this issue on Nov 4, 2026
    101cb47
  2. dmonad commented on Nov 9, 2026

    @dmonad
    Owner

    should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions