Skip to content

Plot.auto - TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event' #1924

Open
@dmeehan1968

Description

@dmeehan1968

I'm trying to use Plot.auto() in a Server Side Rendering (SSR) environment, so using JSDOM to provide a DOM document. When plot() is called, I get a TypeError.

I can't find much information on this, but I believe it might be to do with different instances of window being used. If I specify the mark type, e.g. Plot.rectY it works fine, so think that this might be down to the mark type that auto is choosing based on the data, so no doubt I'll find other instances of marks that fail in this way.

const { document } = new JSDOM('<!DOCTYPE html>').window;
const plot = Plot.auto(penguins, {x: "island"}).plot({document})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions