socketio / socket.io-client

Realtime application framework (client)
https://socket.io
10.62k stars 3.04k forks source link

ESM build for 4.7.2 npm package generates with incorrect package version #1591

Closed bigcakes closed 6 months ago

bigcakes commented 1 year ago

Describe the bug

The 4.7.2 npm version of "socket.io-client" has a build/esm output, that output is specifying "4.4.0" as the version of the module, which causes conflicts in Webpack Module Federation as it isn't the specified version.

{
  "name": "socket.io-client",
  "version": "4.4.0",
  "type": "module"
}

To Reproduce

Please fill the following code example:

Socket.IO server version: Any

Socket.IO client version: 4.7.2

Client

import { io } from "socket.io-client";

If you do that in a Module Federation project, you might end up with an error message similar to this: Unsatisfied version 4.4.0 from testapp of shared singleton module socket.io-client (required =4.7.2)

Expected behavior The version in the ESM build to match the npm version

Platform: Any

Additional context This primarily affects things that check that the provided version match what was specified, like Module Federation.

darrachequesne commented 1 year ago

Well that's embarrassing. We'll update it in the next release.

bigcakes commented 1 year ago

Well that's embarrassing. We'll update it in the next release.

Thank you very much!

darrachequesne commented 8 months ago

This should be fixed in version 4.7.3.

Could you please check?

bigcakes commented 7 months ago

@darrachequesne I just checked out 4.7.4 and it looks like the esm output is

{
  "name": "socket.io-client",
  "type": "module"
}

Which still throws an error since it just isn't specifying a version

darrachequesne commented 6 months ago

OK, I guess we'll have to keep it in sync!

This should be fixed in version 4.7.5, could you please check?

bigcakes commented 6 months ago

This looks to be fixed, thanks @darrachequesne !