mediasoup-client 3.9.3: Incorrect version constant

In version 3.9.3, the version constant is defined as:

export declare const version = "__MEDIASOUP_CLIENT_VERSION__";

instead of the expected version string. This appears to be a build or packaging issue where the placeholder was not properly replaced during the release process.

In the previous version (3.9.2), the value was correctly set:

/**
 * Expose mediasoup-client version.
 */
export declare const version = "3.9.2";

Thank you!

This is not true.

mediasoup-client-aiortc uses mediasoup-client 3.9.1 rather than 3.9.3 and that’s a fixed version as per package-lock.json in mediasoup-client-aiortc:

		"node_modules/mediasoup-client": {
			"version": "3.9.1",
			"resolved": "https://registry.npmjs.org/mediasoup-client/-/mediasoup-client-3.9.1.tgz",

In mediasoup-client 3.9.3, the generated lib/ folder (which is the one present in the NPM package and contains transpiled .js files and TypeScript declarations in .d.ts files) the version constant is ok. You cna verify that within mediasoup-client/lib folder there is NO MEDIASOUP_CLIENT_VERSION string at all.

So the problem is probably that you are somehow using mediasoup-client-aiortc with the latest version of mediasoup-client which is not supported without pending changes in mediasoup-client-aiortc, but again: latest mediasoup-client-aiortc doesn’t depend on mediasoup-client 3.9.3 but on 3.9.1, so this is something in your local setup in which you are updating mediasoup-client version in latest mediasoup-client-aiortc code, but that’s not how it is supposed to be,.

I’m verify as you said, and also trying with the latest mediasoup-client 3.9.4:

package.json

"mediasoup-client": "3.9.4",

package.look.json

        "node_modules/mediasoup-client": {
            "version": "3.9.4",
            "resolved": "https://registry.npmjs.org/mediasoup-client/-/mediasoup-client-3.9.4.tgz",

I took a closer look, and I believe there might be a misunderstanding. The __MEDIASOUP_CLIENT_VERSION__ string does exist in mediasoup-client/lib, specifically in lib/index.js and lib/index.d.ts.

After checking version 3.9.4, running:

grep "__MEDIASOUP_CLIENT_VERSION__" -r node_modules/mediasoup-client

I found:

  • lib/index.js:
    exports.version = '__MEDIASOUP_CLIENT_VERSION__';
    
  • lib/index.d.ts:
    export declare const version = "__MEDIASOUP_CLIENT_VERSION__";
    
  • npm-scripts.mjs:
    const result = text.replace(/__MEDIASOUP_CLIENT_VERSION__/g, PKG.version);
    

Additionally, when I run:

const mediasoupClient = require('mediasoup-client');
console.log(mediasoupClient.version);

The result is:

  • 3.9.4'__MEDIASOUP_CLIENT_VERSION__'
  • 3.9.2'3.9.2'

It looks like in 3.9.4, the build process is not replacing __MEDIASOUP_CLIENT_VERSION__ correctly, which might be causing confusion.

Hope this helps clarify things! Thank you :blush:

You are right. It’0s fixed in 3.9.5: 3.9.5 · versatica/mediasoup-client@0e6f651 · GitHub

Thanks a lot.