Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Doesn't work with ws module #5

Open
piranna opened this issue Sep 14, 2021 · 3 comments
Open

Doesn't work with ws module #5

piranna opened this issue Sep 14, 2021 · 3 comments

Comments

@piranna
Copy link
Collaborator

piranna commented Sep 14, 2021

When importing ws module, it gets the CommonJS version instead of the ESM one, although it has defined both main and exports fields. This last one has conditions for both import and require, in case is this the issue.

@vpzomtrrfrt
Copy link

Looks like the current behaviour just picks the first one from import or require. Probably needs to somehow determine which one should be used

@vpzomtrrfrt
Copy link

ah, since Jest 27.2.0 it should be passing a conditions array to the resolver that could be used for this

@piranna
Copy link
Collaborator Author

piranna commented Dec 22, 2021

ah, since Jest 27.2.0 it should be passing a conditions array to the resolver that could be used for this

Yes, but it's not fully implemented, I still have my PR open to add support by default for the browser and node conditions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants