At least one dependency doesn't support ES modules
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.
Isn't https://github.com/matrix-org/matrix-js-sdk/issues/4287 more of a problem for an ES environment?
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.
Now that #4287 is fixed, it may be worthwhile revisiting this.
Please could you provide a minimal reproduction case?
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]:
@matrix-org/[email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected][email protected](p-retry@6is ESM only)
Indirect CJS only dependencies (* denotes CJS only dependency):
[email protected] *<-@babel/[email protected][email protected] *<-[email protected] *[email protected] *<-[email protected] *(Seep-retryabove)
I'm going to close this, because the information required to reproduce it has not been provided.