Skip to content

crashes when used in node 26 #151

Description

@tyrasd

when running on node 26 globalThis has a stub for localStorage, but accessing it does actually produce an error when started with default parameters:

❯ node
Welcome to Node.js v26.3.0.
Type ".help" for more information.
> 'localStorage' in globalThis
true
> globalThis.localStorage
undefined
> (node:1113098) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)

This results in the check in https://github.com/osmlab/osm-auth/blob/v3.2.0/src/osm-auth.mjs#L30 to be skipped, and later on causing crashes because _store is actually undefined.

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