-
Notifications
You must be signed in to change notification settings - Fork 112
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 28.0.0 and jest-environment-jsdom fails to import use-debounce in tests #132
Comments
this is breaking our server side rendering with webpack as well |
removing "exports": {
".": {
"browser": "./dist/index.module.js",
"umd": "./dist/index.umd.js",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.module.js"
}
}, from package.json solved the problem |
patch-package for now diff --git a/package.json b/package.json
index 43ccad5..1cb6bf2 100644
--- a/node_modules/use-debounce/package.json
+++ b/node_modules/use-debounce/package.json
@@ -7,15 +7,6 @@
"module": "dist/index.module.js",
"esmodule": "dist/index.modern.js",
"umd:main": "dist/index.umd.js",
- "exports": {
- ".": {
- "browser": "./dist/index.module.js",
- "umd": "./dist/index.umd.js",
- "import": "./dist/index.mjs",
- "require": "./dist/index.js",
- "default": "./dist/index.module.js"
- }
- },
"sideEffects": false,
"scripts": {
"size": "yarn build-only && size-limit", |
Sorry, for the long response, and huge thanks to both of you! I updated the exports section dd377cb and tested on the local project with I've published Let me know if everything is okay for you |
it is working well for me, tks |
Great, thanks for the info |
Describe the bug
Importing the package does not work since the Jest 28.0.0 update in combination with
jest-environment-jsdom
.To Reproduce
Expected behavior
The test should run successfully.
use-debounce version: 8.0.0
Additional Information
This problem is also in other packages (described in their docs) https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports
Here is the analysis of the problem and their workaround, which works:
microsoft/accessibility-insights-web#5421 (comment)
microsoft/accessibility-insights-web@9ad4e61
The text was updated successfully, but these errors were encountered: