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 #81

Closed
joelviel opened this issue Mar 28, 2022 · 1 comment
Closed

ReferenceError: window is not defined #81

joelviel opened this issue Mar 28, 2022 · 1 comment

Comments

@joelviel
Copy link

Running the example from https://www.npmjs.com/package/hashconnect with node version 16.14.12

`const { HashConnect } = require( 'hashconnect');
let hashconnect = new HashConnect();

let appMetadata = {
name: "dApp Example",
description: "An example hedera dApp",
icon: "https://absolute.url/to/icon.png"
}

hashconnect.init(appMetadata)
.then(initData => {
let privateKey = initData.privKey
console.log("privateKey", privateKey)
})`

xyz\hconnect\node_modules\hashconnect\dist\hashconnect.js:43
if (window)
^

ReferenceError: window is not defined
at HashConnect. (xyz\hconnect\node_modules\←[4mhashconnect←[24m\dist\hashconnect.js:43:17)
at Generator.next ()
at fulfilled (xyz\node_modules\←[4mtslib←[24m\tslib.js:110:62)

@teacoat
Copy link
Contributor

teacoat commented Mar 30, 2022

hashconnect is meant to be used client side, we do not officially support server side at the moment

@teacoat teacoat closed this as completed Mar 30, 2022
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