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

Attempted import error: 'useForm' is not exported from 'react-hook-form' (imported as 'useForm'). #6335

Open
4 tasks done
pontus-devoteam opened this issue Feb 6, 2025 · 1 comment
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component pending-community-response Issue is pending response from the issue requestor or other community members question General question

Comments

@pontus-devoteam
Copy link

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Next.js

What browsers are you seeing the problem on?

No response

Which region are you seeing the problem in?

No response

Please describe your bug.

Followed your guide:
https://docs.amplify.aws/nextjs/start/quickstart/nextjs-app-router-client-components/

And tried to add
`

{children}

`

Build gave me the result that I shared below.

What's the expected behaviour?

To generate a login/register form.

Help us reproduce the bug!

NPM 0.9.2
Node v22.13.1

Code Snippet

// Put your code below this line.

Console log output

✓ Starting...
✓ Ready in 2.4s
(node:17202) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
○ Compiling / ...
⨯ ./node_modules/@aws-amplify/ui-react-core/dist/esm/components/FormCore/FormProvider.mjs
Attempted import error: 'useForm' is not exported from 'react-hook-form' (imported as 'useForm').

Import trace for requested module:
./node_modules/@aws-amplify/ui-react-core/dist/esm/components/FormCore/FormProvider.mjs
./node_modules/@aws-amplify/ui-react-core/dist/esm/index.mjs
./node_modules/@aws-amplify/ui-react/dist/esm/index.mjs
./app/layout.tsx
⨯ ./node_modules/@aws-amplify/ui-react-core/dist/esm/components/FormCore/FormProvider.mjs
Attempted import error: 'useForm' is not exported from 'react-hook-form' (imported as 'useForm').

Import trace for requested module:
./node_modules/@aws-amplify/ui-react-core/dist/esm/components/FormCore/FormProvider.mjs
./node_modules/@aws-amplify/ui-react-core/dist/esm/index.mjs
./node_modules/@aws-amplify/ui-react/dist/esm/index.mjs
./app/layout.tsx
⨯ ./node_modules/@aws-amplify/ui-react-core/dist/esm/components/FormCore/FormProvider.mjs
Attempted import error: 'useForm' is not exported from 'react-hook-form' (imported as 'useForm').

Import trace for requested module:
./node_modules/@aws-amplify/ui-react-core/dist/esm/components/FormCore/FormProvider.mjs
./node_modules/@aws-amplify/ui-react-core/dist/esm/index.mjs
./node_modules/@aws-amplify/ui-react/dist/esm/index.mjs
./app/layout.tsx

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify UI maintainer labels Feb 6, 2025
@cwomack
Copy link
Member

cwomack commented Feb 6, 2025

Hello, @pontus-devoteam and thanks for opening this issue. Can you verify if you're importing and using use client as seen in this section of the docs? I believe that should resolve the error that you're experiencing.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify UI maintainer label Feb 6, 2025
@cwomack cwomack added question General question Authenticator An issue or a feature-request for an Authenticator UI Component pending-community-response Issue is pending response from the issue requestor or other community members and removed pending-triage Issue is pending triage labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component pending-community-response Issue is pending response from the issue requestor or other community members question General question
Projects
None yet
Development

No branches or pull requests

2 participants