Getting invalid version number error when connecting to peer

I’m getting an error when trying to connect to a node. The IPFS instance is created in a class, with a JavaScript factory function. The connect function looks like this:

async connectToPeer(multiaddr, protocol = "/p2p-circuit/ipfs/") {
    try {
        console.log("swarm.connect: ", protocol + multiaddr);
        await this.node.swarm.connect(protocol + multiaddr);
    } catch (e) {
        throw(e);
    }
}

This will be passed to swarm.connet: /p2p-circuit/ipfs/QmWxWkrCcgNBG2uf1HSVAwb9RzcSYYC2d6CRsfJcqrz2FX

This is the error I get:

(node:24449) UnhandledPromiseRejectionWarning: AggregateError: 
    Error: Invalid version, must be a number equal to 1 or 0
        at Function.validateCID (/home/user/orbit-playground/music-app-no-react/node_modules/cids/src/index.js:312:13)
        at new CID (/home/user/orbit-playground/music-app-no-react/node_modules/cids/src/index.js:151:9)
        at new CID (/home/user/orbit-playground/music-app-no-react/node_modules/class-is/index.js:15:17)
        at Function.exports.createFromCID (/home/user/orbit-playground/music-app-no-react/node_modules/peer-id/src/index.js:248:32)
        at ClassIsWrapper.dial (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/circuit/index.js:107:30)
        at TransportManager.dial (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/transport-manager.js:89:30)
        at DialRequest.dialAction (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/dialer/index.js:149:36)
        at pAny.addrs.map (/home/user/orbit-playground/music-app-no-react/node_modules/libp2p/src/dialer/dial-request.js:58:29)
    at maybeSettle (/home/user/orbit-playground/music-app-no-react/node_modules/p-some/index.js:31:11)
    at /home/user/orbit-playground/music-app-no-react/node_modules/p-some/index.js:69:23

It is able to connect to peers, if I list connected peers the list is not empty.

This looks to be a bug in the relay dialing in libp2p, I created an issue to track this https://github.com/libp2p/js-libp2p/issues/789

Thank you,

this is the context: https://github.com/imestin/orbit-playground/blob/master/music-app-no-react/newpieceplease.js

connectToPeer is at line 179

And it’s called at line 271
NPP.onpeerconnect = console.log; await NPP.connectToPeer("QmWxWkrCcgNBG2uf1HSVAwb9RzcSYYC2d6CRsfJcqrz2FX");

It’s not sure that "QmWxWkrCcgNBG2uf1HSVAwb9RzcSYYC2d6CRsfJcqrz2FX" exists. Although that shouldn’t matter for the validation function.