-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
ReferenceError: window is not defined in Node.js
/Users/ubarbaxor/code/imagery-watcher/node_modules/libcoverage/src/parse.js:12
if (typeof window.DOMParser != "undefined") {
^
ReferenceError: window is not defined
at Object.<anonymous> (/Users/ubarbaxor/code/imagery-watcher/node_modules/libcoverage/src/parse.js:12:1)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/ubarbaxor/code/imagery-watcher/src/index.js:98:21)
at Module._compile (module.js:624:30)
I've been checking in src/parse.js:12 there's something in the taste of :
if (typeof window.DOMParser != "undefined") { ... }
else if (typeof window.ActiveXObject != "undefined" &&
new window.ActiveXObject("Microsoft.XMLDOM")) { ... }
This causes ReferenceError: window is not defined in node.js.
A simple solution would be to wrap the whole block in something in the taste of :
if (typeof window != "undefined") { ... }
I'm not sure this lib is meant to be usable in node, currently trying it to integrate DigitalGlobe API, so I had to fork and fix this myself.
I'm willing to issue a PR in case this issue can be addressed.
Metadata
Metadata
Assignees
Labels
No labels