-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Use next.js 10 @hookform/resolvers yup to get the following error SyntaxError: Cannot use import statement outside a module #105
Comments
Same as #100 I'm working on resolvers's V2 which will have a better bundle supports. |
I have the exact same issue but with |
@jorisre Using 1.3.0 is the same situation, other versions 1.2.0 ~ 1.0.0 have been tried, all in the same situation. do not know why? |
@jq153387 1.3.0 works, make sure you use the exact version and not ^1.3.0. |
@la55u Thank you so much, I don't quite understand the difference between 1.3.0 and ^1.3.0? About node.js ^ in package.json dependency version https://stackoverflow.com/questions/22565344/in-package-json-dependency-version |
@jq153387 yarn add @hookform/resolvers@1.3.0 (exact version) fixes the issue for me. If you use the caret ^ it means there could be a minor patch, e.g. 1.3.1, which doesn't work here. |
I am getting a similar error in |
Make sure you are importing: import { zodResolver } from '@hookform/resolvers/zod'; and not: import { zodResolver } from '@hookform/resolvers/zod/dist/zod'; That was my problem (the IDE picked this import for some reason). |
SyntaxError: Cannot use import statement outside a module
Use next.js 10 @hookform/resolvers yup to get the following error
The text was updated successfully, but these errors were encountered: