-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Latest deployment(1.0.0) broken ESM import in Jest/Enzyme #4014
Comments
I have been experiencing a similar issue with the latest release of Enzyme was first implemented against But |
Related to what we are all experiencing in my group since the version Seems like this has really taken all the depending packages by surprise, breaking things, yet no answer by the library maintainers (have a look at what we're suggesting in #3993 ) |
At the moment I have resolved this by forcing our package manager(pnpm) to use a specific version of cheerio. In the root package.json we have this. {
"pnpm": {
"overrides": {
"cheerio": "1.0.0-rc.12"
},
} My problem went away. This obviously has a negative side effect for forcing ANYTHING using cheerio to use this version, so use carefully. Also it will always use this version until you remove it. Be sure to reevaluate this issue periodically to see if it has been resolved and you can remove this constraint. All very obvious statements but I like to be through. |
This is a good temporary workaround. I don't think it's a good practice to ask for all the community (those 8 Million downloads) to implement this in their package.json till they can migrate their codebase to whatever If the maintainers of |
I have a library which I just converted over to ESM(forced to because of another dependency). It took a LONG time to get it all working(stupid ecosystem change). But since the latest update to cheerio my Jest tests are failing. I am not sure what changed in cheerio as I do not use it directly. I use enzyme which has a dependency on cheerio. All this will make giving a working example VERY difficult. I can give you the error I am getting and I can try and give you the particulars of my set up. If there is anything else I can give you please let me know.
Here is the error
Must use import to load ES Module: /Users/me/source/.../my-project/node_modules/.pnpm/cheerio@1.0.0/node_modules/cheerio/dist/browser/index.js
Here is roughly my setup
packge.json
jest.config.mjs
setup.mjs
tsconfig.json
The text was updated successfully, but these errors were encountered: