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

regeneratorRuntime is not defined #42

Open
maucrvlh opened this issue May 5, 2018 · 1 comment
Open

regeneratorRuntime is not defined #42

maucrvlh opened this issue May 5, 2018 · 1 comment

Comments

@maucrvlh
Copy link

maucrvlh commented May 5, 2018

Trying to run this code:

const { Provider } = require("node-webcrypto-p11");
const provider = new Provider("/usr/lib/libaetpkss.so.3");

let tokens = 0;
provider
    .on("listening", (info) => {
        console.log("listening");
        console.log(info);
        console.log(`Providers: ${info.providers.length}`);

        tokens = info.providers.length;
    })
    .on("token", (info) => {
        console.log("Removed:", info.removed);
        console.log("Added:", info.added);
    })
    .on("error", (e) => {
        console.error(e);
    })

provider.open();

Returns:
image

@microshine
Copy link
Contributor

You need to use babel-polyfill. node-webcrypto-p11 uses PKIjs which doesn't work without babel module

Add this line to your code

require("babel-polyfill")

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