Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

TypeError: TestWeave.init is not a function #9

Open
linhai0212 opened this issue Jan 14, 2022 · 2 comments
Open

TypeError: TestWeave.init is not a function #9

linhai0212 opened this issue Jan 14, 2022 · 2 comments

Comments

@linhai0212
Copy link

TypeError: TestWeave.init is not a function error occurs when using express on express, how to solve it?

@linhai0212
Copy link
Author

linhai0212 commented Jan 14, 2022

var Arweave = require('arweave');
var TestWeave = require('testweave-sdk');

...

/* GET home page. */
router.get('/',   function (req, res, next) {
  let arweave = Arweave.init({
    host: '127.0.0.1',
    port: 1984,
    protocol: 'http',
    timeout: 20000,
    logging: false,
  })

  console.log("TestWeave", TestWeave);
  TestWeave.init(arweave).then((aa) => {
    console.log(aa)
  })
  res.render('index', {title: 'Express'});
});

@pnutmath
Copy link

pnutmath commented Feb 1, 2022

@linhai0212 use like below for now v0.2.2

const { default: TestWeave } = require('testweave-sdk');

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

No branches or pull requests

2 participants