Closed kochie closed 3 weeks ago
While writing this bug report I had an idea about what the issue is, because there is no server with next export
the ssr
setting should be false
. This turned out to be correct so if anyone experiences this issue in the future I thought I'd add it here.
The fix is very simple
'use client';
import { Amplify, ResourcesConfig } from 'aws-amplify';
const outputs: ResourcesConfig = {
Auth: {
Cognito: {
userPoolId: process.env.NEXT_PUBLIC_USERPOOL_ID!,
userPoolClientId: process.env.NEXT_PUBLIC_USERPOOL_CLIENT_ID!,
userPoolEndpoint: process.env.NEXT_PUBLIC_AUTH_URL,
},
},
};
Amplify.configure(outputs, { ssr: false });
export default function ConfigureAmplifyClientSide() {
return null;
}
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
CDK
Environment information
Describe the bug
I am having an issue with an app I am building where in the built production version users cannot log in. The app is an electron/nextjs project. When I run in developer mode there is no problem however when I export the build in next.js the login fails with
UnexpectedSignInInterruptionException
.My current amplify configuration is as follow
Expected behavior
Login should work the same in development mode and production.
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response