-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest with Node.js v20.11.0 does not understand overlayscrollbars-react #604
Comments
Good day @krutoo
It defines the |
@KingSora hmmm, for some reason Jest does not understand that this file must be interpreted as an ESM |
@krutoo Would you be able to create an example repository with your jest setup and a library which works with it? I could take a look what could potentially be wrong there. |
@KingSora Here is repo with reproduction of problem: Just make In my computer i have Node.js v20.11.0 |
@KingSora sorry for wrong link, I fixed it |
Also experiencing this issue with Node 20.11 |
Do you need maybe "type": "module"? |
@krutoo @lpjune @Smrtnyk I've identified the issue and will publish a fix soon :) The problem is that even though the package jsons "exports": {
".": {
"require": "./overlayscrollbars-react.cjs.js",
"import": "./overlayscrollbars-react.es.js",
"types": "./types/overlayscrollbars-react.d.ts"
}
} Jest or node is reading the |
@KingSora Please also note that the order of the keys matters according to the docs Conditional exports:
|
if you set "type": "module" you should not need mjs as extension |
@Smrtnyk Thats true, but it would also read the |
Regaring the extensions
In that sense if you have |
I'd also recommend linting your package with publint. |
@krutoo I'll continue to provide @ChristophP Thank you for the input - really appreciate it! @nickmccurdy Very useful tool, I'll definitely use it before I publish the fixed versions - Thanks a bunch! |
I've published:
Which all address this issue and should hopefully fix it properly. Please try it out and give feedback :) |
@KingSora Yes, it helped in example repo and in my project, thank you so mush Can you tell me what exactly you did to fix this problem? Issue can be closed i think |
@krutoo I've changed the package.jsons To see exactly how the I changed the files you can compare the old and new versions. |
Hi, i noticed about "module" field in
package.json
is not standard way to define ESM entry point of package.According this answer:
jestjs/jest#9430 (comment)
Can we update
package.json
of overlayscrollbars packages for to comply with the standard?The text was updated successfully, but these errors were encountered: