TypeError: callback is not a function
at /tmp/node_modules/dnscrypt/src/dnscrypt.js:163:7
at AsyncQuery.callback (/tmp/node_modules/dnscrypt/src/dnscrypt.js:137:7)
at Protocol.onresponse (/tmp/node_modules/dnscrypt/src/protocol.js:266:14)
at Protocol.onmessage (/tmp/node_modules/dnscrypt/src/protocol.js:151:14)
at Socket. (/tmp/node_modules/dnscrypt/src/protocol.js:68:51)
at Socket.emit (events.js:210:5)
at UDP.onMessage [as onmessage] (dgram.js:910:8)
/tmp/node_modules/next-state/src/index.js:54
throw new TypeError('Invalid state set');
^
TypeError: Invalid state set
at StateMachine.next (/tmp/node_modules/next-state/src/index.js:54:13)
at Protocol.forgetCertificate (/tmp/node_modules/dnscrypt/src/protocol.js:78:20)
at DNSCrypt.close (/tmp/node_modules/dnscrypt/src/dnscrypt.js:53:19)
at /tmp/node_modules/dnscrypt/src/dns.js:30:9
at /tmp/node_modules/dnscrypt/src/dnscrypt.js:163:7
at AsyncQuery.callback (/tmp/node_modules/dnscrypt/src/dnscrypt.js:137:7)
at Protocol.onresponse (/tmp/node_modules/dnscrypt/src/protocol.js:266:14)
at Protocol.onmessage (/tmp/node_modules/dnscrypt/src/protocol.js:151:14)
at Socket.<anonymous> (/tmp/node_modules/dnscrypt/src/protocol.js:68:51)
at Socket.emit (events.js:210:5)
I'm using NodeJS v13.1.0 but it didn't work with NodeJS v12.13.0 and v8.16.2 too.
Maybe I'm missing something in the code?
Hello I tried the example code in the
Usage
section but it doesn't seem to work:dnscrypt.resolve('example.com', (err, addresses) => { if (err) { console.error(err); } else { console.log(addresses); } });
/tmp/node_modules/dnscrypt/src/dnscrypt.js:163 callback(null, addresses); ^
TypeError: callback is not a function at /tmp/node_modules/dnscrypt/src/dnscrypt.js:163:7 at AsyncQuery.callback (/tmp/node_modules/dnscrypt/src/dnscrypt.js:137:7) at Protocol.onresponse (/tmp/node_modules/dnscrypt/src/protocol.js:266:14) at Protocol.onmessage (/tmp/node_modules/dnscrypt/src/protocol.js:151:14) at Socket. (/tmp/node_modules/dnscrypt/src/protocol.js:68:51)
at Socket.emit (events.js:210:5)
at UDP.onMessage [as onmessage] (dgram.js:910:8)
It returns this error:
I'm using NodeJS v13.1.0 but it didn't work with NodeJS v12.13.0 and v8.16.2 too. Maybe I'm missing something in the code?