jsun969 / react-hook-form-antd

๐Ÿ“‹๐Ÿœ Master your Ant Design form with React Hook Form! ็”จ React Hook Form ๆ‹ฟๆไฝ ็š„ Ant Design ่กจๅ•๏ผ
https://npm.im/react-hook-form-antd
MIT License
61 stars 10 forks source link

Jest test suite failed to run. Cannot use import statement outside a module #96

Open Anav11 opened 3 months ago

Anav11 commented 3 months ago

Hi! I get an error when running my jest tests. btw transformIgnorePatterns didn't help

/node_modules/react-hook-form-antd/dist/index.js:34
    import { Form as AntdForm } from "antd";
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module
jsun969 commented 3 months ago

Since it's working in my test, could you provide the version you are using and a minimal reproduction?

Anav11 commented 3 months ago

https://stackblitz.com/edit/vitejs-vite-yq5e2f?terminal=dev

jsun969 commented 3 months ago

Much appreciate! I'll take a look ASAP.

akshays-repo commented 2 months ago

i am facing the same issue any solution for this @jsun969 @Anav11

jsun969 commented 2 months ago

Sry for the late reply. That's kinda weird, is it working in your webpage? Could you provide the version you're using and try to downgrade it to see if it works?

Anav11 commented 1 month ago

Could you please take another look at the link I provided? It allows you to downgrade the library version. The issue still reproduces even after downgrading.

jsun969 commented 1 month ago

@Anav11 Yea thx. I'll try to address it.

Anav11 commented 2 days ago

We should just use vitest instead of jest. Can be closed

jsun969 commented 2 days ago

We should just use vitest instead of jest. Can be closed

Sry I can't close it. Jest should still be an option for testing. I can't enforce people to switch to vitest because of this library.