This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Nondescript error when using get/set functions #31
Comments
Hey, |
var web3 = uport.getWeb3()
Registry.setProvider(web3.currentProvider)
var registry;
Registry.deployed().then(function(instance) {
registry = instance;
});
//
//much later
//
var daddr = mnid.decode(req.body.addr)
var addr=daddr.address;
var hash="someValue";
let key = "myKey"
console.log(daddr);
console.log(registry);
let subject = addr
let value = hash;
registry.set(key, subject, value); |
Hm, I have no problem with that. Did you import the registry this way? const regsitryArtifact = require('uport-registry')
const Contract = require('truffle-contract')
const Registry = Contract(regsitryArtifact) |
const regsitryArtifact = require('uport-registry')
const Contract = require('truffle-contract')
var mnid = require('mnid')
var Registry = Contract(regsitryArtifact) This is how I'm importing it |
That's strange. However I'm unable to reproduce this error. |
Yes it the call to registry.set that throws the error
I just ran it again, same error posting the full log for your benefit:
(node:16904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ReferenceError: document is not defined
(node:16904) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
…On Mon, Jul 10, 2017 at 2:34 PM, Joel Torstensson ***@***.***> wrote:
That's strange. However I'm unable to reproduce this error.
Is it the call to registry.set(key, subject, value); that gives you the
promise rejection?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3f1jTgW9aEhCZe0oVMpiisT4aXlQHrks5sMm7AgaJpZM4OJxRL>
.
--
Best Regards,
Samson Kirk-Koffi
|
I am running this code on my node-js server, not in the frontend like the uport-connect example. It just occurred to me that this might be the cause. Can you confirm? |
Ok, so what library are you using for doing |
const uportCon = require('uport-connect');
const uport = new uportCon.Connect('MyDApp')
var web3 = uport.getWeb3() |
Oh, right. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am building an application that uses uport and registry, while setting or getting key/value pairs on the registry I keep getting this error
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: