Cannot read property 'forEach' of undefined
AliAtefAli opened this issue · comments
I want to connect the client web page for socketIO and admin-UI.
But this error appeared.
When I use the code below.
const { createServer } = require("http");
const Server = require("socket.io");
const { instrument } = require("@socket.io/admin-ui");
const httpServer = createServer();
const io = new Server(httpServer, {
cors: {
origin: ["https://admin.socket.io"],
credentials: true
}
});
instrument(io, {
auth: false
});
httpServer.listen(3000);
Same problem here.
@gutocf which version of the socket.io
package are you using? v2?
The module is compatible with:
- Socket.IO v4 server
- Socket.IO v3 server (>= 3.1.0), but without the operations on rooms (join, leave, disconnection)
Also having such errors. First I login (had to remove the trailing slash in server url to make it work).
Then I have empty inerface and tabs. I have to select the "/" namespace
to see something, but only in Events tab. Other tabs are empty and I see javascript errors:
also I have lot of unhealhty servers growing up
Tried on firefox and chromium. When I enter wrong server url (the one with trailing slash), firefox display xhr error and I have to change server url. Chromium also displays an error, but popin disappear and I can enter to a blank admin ui.
I use socket.io 4.5.4
"socket.io": "^4.5.4",
"socket.io-client": "^4.5.4",
And instrumented the server with
const app = express();
const server = http.createServer(app);
const io = new Server(server, {
cors: {
origin: ['https://admin.socket.io'],
credentials: true,
},
});
instrument(io, {
auth: false,
mode: 'development',
});
Ok my bad, I had a custom parser, which was not expected by admin ui...