Skip to content
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

Build error after upgrade to 1.3.1 in Next.js #100

Closed
nghieptiki opened this issue Dec 31, 2020 · 7 comments
Closed

Build error after upgrade to 1.3.1 in Next.js #100

nghieptiki opened this issue Dec 31, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@nghieptiki
Copy link

Hi guys,

I have an SSR app working on Node environments, after upgrade to 1.3.1 and build error:

[2020-12-31T02:56:35.428Z] #16 90.33 > Build error occurred
[2020-12-31T02:56:35.428Z] #16 90.34 /app/node_modules/@hookform/resolvers/dist/yup.js:2
[2020-12-31T02:56:35.428Z] #16 90.34 import { transformToNestObject, } from 'react-hook-form';
[2020-12-31T02:56:35.428Z] #16 90.34 ^^^^^^
[2020-12-31T02:56:35.428Z] #16 90.34
[2020-12-31T02:56:35.428Z] #16 90.34 SyntaxError: Cannot use import statement outside a module
[2020-12-31T02:56:35.428Z] #16 90.34 at wrapSafe (node:internal/modules/cjs/loader:1024:16)
[2020-12-31T02:56:35.428Z] #16 90.34 at Module._compile (node:internal/modules/cjs/loader:1072:27)

I think the problem related to #95 PR.

@joshmanders
Copy link

Getting the same thing. Downgrading to 1.2.0 fixes it.

@jorisre
Copy link
Member

jorisre commented Dec 31, 2020

Thanks for reporting.
I'm working on resolvers's V2 which will have a better module supports.

As a workaround, you can use 1.3.0

@Rykuno
Copy link

Rykuno commented Jan 4, 2021

Thanks for reporting.
I'm working on resolvers's V2 which will have a better module supports.

As a workaround, you can use 1.3.0

Bumping down to 1.3.0 does not solve for me. Thanks for your hard work, looking forward to V2 with module support. While this is currently putting a hold on validation we have been overall loving react-hook-form.

{
   "@hookform/resolvers": "^1.3.0",
    "react-hook-form": "^6.14.0",
    "next": "^10.0.4",
}

@msheakoski
Copy link

msheakoski commented Jan 4, 2021

@Rykuno You need to use "1.3.0", not "^1.3.0". Using the ^ means greater than or equal to 1.3.0 but less than 2.0.0. Because of this, you still end up installing 1.3.1 or whatever the latest release is that satisfies the version constraint.

You can read more about it here: https://docs.npmjs.com/cli/v7/using-npm/semver#caret-ranges-123-025-004

@Rykuno
Copy link

Rykuno commented Jan 4, 2021

@Rykuno You need to use "1.3.0", not "^1.3.0". Using the ^ means greater than or equal to 1.3.0 but less than 2.0.0. Because of this, you still end up installing 1.3.1 or whatever the latest release is that satisfies the version constraint.

You can read more about it here: https://docs.npmjs.com/cli/v7/using-npm/semver#caret-ranges-123-025-004

Doh. I caught we caught this in a PR this afternoon and came to correct what you just mentioned haha! Wish I read this last night.

@jorisre
Copy link
Member

jorisre commented Jan 5, 2021

Thanks everyone for reporting and for provide informations to help us.

I close this issue because it's related to #71.

We published a v2 beta which solve this issue, more info here: #71 (comment)

@jorisre
Copy link
Member

jorisre commented Mar 26, 2021

👋🏻
You can try the last version v1.3.6. The issue should be solved

@jorisre jorisre closed this as completed Mar 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants