Channel js timeout if using new Channel instead of Socket.channel

Hi, I am having timeouts on client (JS) side if using channel = new Channel(…) format instead of Socket.channel(…) format. On Elixir side, though, I get a join conformation.

This code gives timeout on js side (using new Channel):

let channel;
app.ports.joinRoom.subscribe(function (room) {
console.log(JS will ask Phoenix to join room: , room);
channel = new Channel(“games:” + room,{ name: “My name” },socket);
channel
.join()
.receive(“ok”, (resp) => {
console.log("Joined successfully room " + room, resp);
})
.receive(“error”, (resp) => {
console.log(“Unable to join”, resp);
})
.receive(“timeout”, () =>
console.log(
"Networking issue trying to connect to room " +
room +
“. Still waiting…”
)
);

channel.on(“broadcast_game_table”, (payload) => {
console.log(
JS: Receiving ${payload} game table data from Phoenix,
payload
);
app.ports.receiveGameTableFromServer.send(payload);
console.log(“JS finished sending game table to Elm”);
});
});

This code works properly:

let channel;
app.ports.joinRoom.subscribe(function (room) {
console.log(JS will ask Phoenix to join room: , room);
channel = socket.channel(“games:” + room, { name: “My name” });
channel
.join()
.receive(“ok”, (resp) => {
console.log("Joined successfully room " + room, resp);
})
.receive(“error”, (resp) => {
console.log(“Unable to join”, resp);
})
.receive(“timeout”, () =>
console.log(
"Networking issue trying to connect to room " +
room +
“. Still waiting…”
)
);

channel.on(“broadcast_game_table”, (payload) => {
console.log(
JS: Receiving ${payload} game table data from Phoenix,
payload
);
app.ports.receiveGameTableFromServer.send(payload);
console.log(“JS finished sending game table to Elm”);
});
});

Is this a bug or something I am doing wrong?

Thanks!