Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: window is not defined #18

Open
kumavis opened this issue Jul 30, 2019 · 1 comment
Open

ReferenceError: window is not defined #18

kumavis opened this issue Jul 30, 2019 · 1 comment

Comments

@kumavis
Copy link
Contributor

kumavis commented Jul 30, 2019

in node

ReferenceError: window is not defined
    at Object.<anonymous> (/home/xyz/Development/cosmos-key/node_modules/@lunie/cosmos-keys/lib/cosmos-keys.js:1:224)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/xyz/Development/cosmos-key/index.js:3:34)
    at Module._compile (internal/modules/cjs/loader.js:776:30)

work around:

global.window = global
require(...)
@webmaster128
Copy link

Before being shipped to npm, cosmos-keys is built for the Webpack target web (the default). Since there is no separate WebPack build for node, I would not expect the package to reliably run in Node.js at all. See https://webpack.js.org/concepts/targets/ and https://webpack.js.org/configuration/target/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants