-
Notifications
You must be signed in to change notification settings - Fork 98
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
Incompatibility of resize-observer with Nextjs 12. #172
Comments
Not clear to me this is my issue vs. Next's |
Hello, it's not clear to me either. Have you maybe tried to reproduce it? |
I'm using other hooks in this group that use the same |
I'm getting this - NextJS@12^ but it only throws in my Jest@28 tests |
Hi, it may be late, but for future user encountering this issue, I found a fix. This is the same as here react-hook-form/resolvers#396 (comment) But instead filter out the pkg this way if (typeof pkg.name === 'string' && pkg.name.startsWith('@react-hook/')) {
delete pkg['exports'];
delete pkg['module'];
} |
Solved it for me. I'm not using next, but had this issue while migrating to jest28 and 29 in a react library project. |
Describe the bug
We have updated our project to Next 12 and the following appears when we load a page with a component that uses resize-observer.
SyntaxError: The requested module 'react' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export. For example: import pkg from 'react'; const {useRef: r,useEffect: t}from"react";export default e=>{var a=r(e);return t(()=>{a.current=e}),a} = pkg;
To Reproduce
Steps to reproduce the behavior:
Screenshots

Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: