You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On which framework/platform are you having an issue?
Other
Which UI component?
Authenticator
How is your app built?
Next.js
What browsers are you seeing the problem on?
Chrome
Which region are you seeing the problem in?
No response
Please describe your bug.
When following the Quickstart the step of including the Authenticator component in the layout fails. The problem is that one dependency package cannot import a hook from another.
What's the expected behaviour?
The Quickstart should work.
Help us reproduce the bug!
Just follow the Quickstart without any modification.
Code Snippet
// Put your code below this line.importtype{Metadata}from"next";import{Inter}from"next/font/google";import"./app.css";import{Authenticator}from"@aws-amplify/ui-react";import"@aws-amplify/ui-react/styles.css";constinter=Inter({subsets: ["latin"]});exportconstmetadata: Metadata={title: "Create Next App",description: "Generated by create next app",};exportdefaultfunctionRootLayout({
children,}: {children: React.ReactNode;}){return(<htmllang="en"><bodyclassName={inter.className}><Authenticator>{children}</Authenticator></body></html>);}
Console log output
./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
OK. I figured it out. layout.tsx must be on the client. This is inconvenient given that I usually load text translations from json files on the server in layout.tsx. Can the Authenticator wrapper be deeper in the app?
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
Other
Which UI component?
Authenticator
How is your app built?
Next.js
What browsers are you seeing the problem on?
Chrome
Which region are you seeing the problem in?
No response
Please describe your bug.
When following the Quickstart the step of including the Authenticator component in the layout fails. The problem is that one dependency package cannot import a hook from another.
What's the expected behaviour?
The Quickstart should work.
Help us reproduce the bug!
Just follow the Quickstart without any modification.
Code Snippet
Console log output
./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
{
"name": "aws-amplify-gen2",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@aws-amplify/ui-react": "^6.5.5",
"aws-amplify": "^6.6.6",
"next": "^14.2.23",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@aws-amplify/backend": "^1.5.1",
"@aws-amplify/backend-cli": "^1.3.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"aws-cdk": "^2",
"aws-cdk-lib": "^2",
"constructs": "^10.3.0",
"esbuild": "^0.23.1",
"tsx": "^4.19.0",
"typescript": "^5.6.2"
}
}
The text was updated successfully, but these errors were encountered: