matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

At least one dependency doesn't support ES modules

Open lukasz-zaroda opened this issue 1 year ago • 2 comments

It looks like this package doesn't fully support ESM because at least one of its dependencies doesn't support it. I mean sdp-transform here. Maybe for bundlers it doesn't matter, but it's impossible to use this lib in a pure ESM environment, like with a Symfony's AssetMapper.

lukasz-zaroda avatar Jul 20 '24 15:07 lukasz-zaroda

Isn't https://github.com/matrix-org/matrix-js-sdk/issues/4287 more of a problem for an ES environment?

richvdh avatar Jul 22 '24 11:07 richvdh

Isn't #4287 more of a problem for an ES environment?

Possibly. I couldn't even require this library in AssetMapper, though, because it failed on the sdp-transform library when figuring out dependencies, so it's possible that even if sdp-transform would not be a problem, I would stumble on something else later. These issues are not mutually exclusive.

lukasz-zaroda avatar Jul 22 '24 11:07 lukasz-zaroda

Now that #4287 is fixed, it may be worthwhile revisiting this.

Please could you provide a minimal reproduction case?

richvdh avatar Jan 02 '25 12:01 richvdh

While I have no idea about how to do ESM only import environment in Node.js/Deno/Bun, using tools like Node Modules Inspector and pkg-size.dev I can find what dependencies can only be imported through CJS.

These are the packages that can only imported from CJS for [email protected]:

Indirect CJS only dependencies (* denotes CJS only dependency):

ShadowRZ avatar Feb 15 '25 12:02 ShadowRZ

I'm going to close this, because the information required to reproduce it has not been provided.

richvdh avatar Feb 16 '25 17:02 richvdh