Issue: Creating bundle in Libp2p

Hi team,
I was trying to integrate a libp2p application in Ethereum Blockchain. While building a libp2p bundle, I get an error message as below:

Error: Expected a value of type undefined for transport but received [{},{"sioOptions":{"transports":["websocket"],"force new connection":true},"discovery":{"_events":{},"_eventsCount":0},"listenersRefs":{}}].

Code in index.js:

const node = new Node(peerInfo, peerBook, {
webRTCStar: true
})
...
...

class Node extends libp2p {
constructor (peerInfo, peerBook, options) {
options = options || {}
const wstar = new WebRTCStar()
const modules = {
transport: [new WS(), wstar],
connection: {
muxer: [mplex],
crypto: [secio]
},
discovery: [wstar.discovery]
}
super(modules, peerInfo, peerBook, options)
}
}

I don’t understand why showing the error messages. I tested the same libp2p application in meanstack and it works fine. Any ideas?

What version of js-libp2p are you using? The construction is old, js-libp2p only takes a single argument, options. Take a look at the readme and examples, https://github.com/libp2p/js-libp2p/tree/v0.25.4#creating-your-own-libp2p-bundle, for what that looks like.