[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

ReferenceError: navigator is not defined (using Node.js) #242

Open
GalaxySH opened this issue Feb 5, 2020 · 1 comment
Open

ReferenceError: navigator is not defined (using Node.js) #242

GalaxySH opened this issue Feb 5, 2020 · 1 comment

Comments

@GalaxySH
Copy link
GalaxySH commented Feb 5, 2020

Downloaded the library with npm and trying to use it with node, I am trying to make an image using this and d3.

const saveSvgAsPng = require("save-svg-as-png");
...
saveSvgAsPng.saveSvgAsPng(chart, "ch.png");
@GalaxySH
Copy link
Author
GalaxySH commented Feb 5, 2020

I just added var navigator = {} and that error went away, but now it's saying that document isn't defined, but I defined it in the file I'm requiring it as with const document = new JSDOM().

@exupero exupero changed the title ReferenceError: navigator is not defined ReferenceError: navigator is not defined (using Node.js) Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant