Git Product home page Git Product logo

tss-wasm's Issues

Headers is not defined for target=nodejs

index.js:

const { gg18 } = require("@ieigen/tss-wasm-node");

async function main() {
  const t = 1;
    const n = 3;
    context = await gg18.gg18_keygen_client_new_context(
      "http://127.0.0.1:8000",
      t,
      n
    );
    console.log("keygen new context: ", context);
    context = await gg18.gg18_keygen_client_round1(context);
    console.log("keygen round1: ", context);
    context = await gg18.gg18_keygen_client_round2(context);
    console.log("keygen round2: ", context);
    context = await gg18.gg18_keygen_client_round3(context);
    console.log("keygen round3: ", context);
    context = await gg18.gg18_keygen_client_round4(context);
    console.log("keygen round4: ", context);
    const keygen_json = await gg18.gg18_keygen_client_round5(context);
    console.log("keygen json: ", keygen_json);
    res.json(util.Succ(keygen_json));
}

main().then(() => {
  console.log("done")
})

run: node index.js
error:

post resp Err(reqwest::Error { kind: Builder, source: "JsValue(ReferenceError: Headers is not defined\nReferenceError: Headers is not defined\n    at /Users/Project/dev/tss-wasm/pkg/tss_wasm.js:549:17\n    at handleError (/Users/Project/dev/tss-wasm/pkg/tss_wasm.js:438:18)\n    at module.exports.__wbg_new_4cba26249c1686cd (/Users/Project/dev/tss-wasm/pkg/tss_wasm.js:548:65)\n    at wasm://wasm/008f18ba:wasm-function[1139]:0xf66ee\n    at wasm://wasm/008f18ba:wasm-function[100]:0x5c0d0\n    at wasm://wasm/008f18ba:wasm-function[177]:0x8e261\n    at wasm://wasm/008f18ba:wasm-function[276]:0xae7df\n    at wasm://wasm/008f18ba:wasm-function[822]:0xebae7\n    at wasm://wasm/008f18ba:wasm-function[601]:0xdbb8a\n    at wasm://wasm/008f18ba:wasm-function[1258]:0xf7cef)" })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.