Skip to content

Navigator detection would work incorrectly in Node 22+ #45

@denisoby

Description

@denisoby

Node 22 has global navigator object, so this check should be updated accordingly

var inBrowser = typeof navigator !== 'undefined';

Related links
nodejs/node#39540
https://nodejs.org/docs/latest/api/globals.html#navigatoruseragent

console.log(`The user-agent is ${navigator.userAgent}`); // Prints "Node.js/21" 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions