Skip to content

requiring socket.io-client no longer works in 4.3.0 #1508

@barisusakli

Description

@barisusakli

On socket.io-client 4.2.0. I can require it and connect server side like this

const io = require('socket.io-client');
const socket = io(nconf.get('base_url'), {
	path: `/socket.io`,
	extraHeaders: {
		Origin: nconf.get('url'),
		Cookie: cookie,
	},
});

This stopped working with 4.3.0, with the following error. Uncaught TypeError: io is not a function

I have to modify the code to

const socket = io.io(nconf.get('base_url'), {
	path: `/socket.io`,
	extraHeaders: {
		Origin: nconf.get('url'),
		Cookie: cookie,
	},
});

To make it work, not sure if this is intended or a side effect of the changes in 4.3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions