Skip to content

SSR broken when Navigator object is defined. Node JS 21. #1046

@sannajammeh

Description

@sannajammeh

Some environments have Navigator as an empty object even on the server.

Node JS v21 has navigator defined as an empty object.

This causes libraries like echarts to be incompatible with ssr and crash.

The problem is line 35 in zrender/lib/core/env.js

else if (typeof navigator === 'undefined')

Should ideally be:

else if (typeof window === '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