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

can't read property generateSecretASCII of undefined #145

Open
edugrip opened this issue Nov 5, 2022 · 2 comments
Open

can't read property generateSecretASCII of undefined #145

edugrip opened this issue Nov 5, 2022 · 2 comments

Comments

@edugrip
Copy link

edugrip commented Nov 5, 2022

When I try to create the image, with the following code,
var secret = generateSecret({
name: "mySecret",
})
The line 458 in index.js generates an error
....
var key = this.generateSecretASCII(length, symbols);

this is undefined here. (I get an error can't read property generateSecretASCII of undefined)
When I change this to exports, it works. team, kindly find out and guide to fix the issue.

@kauebkf
Copy link

kauebkf commented Dec 13, 2022

If you are using import syntax, change it to express one. Like this: const speakeasy = require('speakeasy');

@edugrip
Copy link
Author

edugrip commented Dec 17, 2022

Quick solution: go to the source of this and change this.generateSecretASCII to exports.generateSecretASCII. But later, if it gets overwritten, the problem will recur, so I suggest creating a pull request for this, and fix it permanently.

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