When trying to sign-in using Google auth, it says: OAuth - Error handling auth response. Error: Internal+server+error - amazon-cognito

My app have multiple environments (dev, staging, and production). I set up Google Sin-in in the dev environment and everything works fine. But when switched to the staging environment, it breaks. Click on Google sign-in > Click on the google account or sign-in to the google account > Re-direct to the app > The user does not get signed-in. When I check the console, it shows the following error:
next-dev.js?7fd2:24 [ERROR] 08:01.238 OAuth - Error handling auth response. Error: Internal+server+error.+
at OAuth.eval (OAuth.js?ca4e:244:1)
at step (OAuth.js?ca4e:55:1)
at Object.eval [as next] (OAuth.js?ca4e:36:46)
at eval (OAuth.js?ca4e:30:1)
at new Promise (<anonymous>)
at __awaiter (OAuth.js?ca4e:26:1)
at OAuth.handleAuthResponse (OAuth.js?ca4e:220:1)
at AuthClass.eval (Auth.js?134d:2271:1)
at step (Auth.js?134d:55:1)
at Object.eval [as next] (Auth.js?134d:36:46)
at eval (Auth.js?134d:30:1)
at new Promise (<anonymous>)
at __awaiter (Auth.js?134d:26:1)
at AuthClass._handleAuthResponse (Auth.js?134d:2233:1)
at eval (Auth.js?134d:229:1)
at eval (urlListener.js?d88e:17:1)
at AuthClass.configure (Auth.js?134d:223:24)
at eval (Amplify.js?b2f6:84:1)
at Array.map (<anonymous>)
at AmplifyClass.configure (Amplify.js?b2f6:83:1)
at eval (configureAmplify.js?89ed:10:1)
at ./configureAmplify.js (_app.js?ts=1660300676845:34680:1)
at options.factory (webpack.js?ts=1660300676845:698:31)
at __webpack_require__ (webpack.js?ts=1660300676845:37:33)
at fn (webpack.js?ts=1660300676845:353:21)
at eval (_app.js:12:75)
at ./pages/_app.js (_app.js?ts=1660300676845:35758:1)
at options.factory (webpack.js?ts=1660300676845:698:31)
at __webpack_require__ (webpack.js?ts=1660300676845:37:33)
at fn (webpack.js?ts=1660300676845:353:21)
at eval (?9413:5:16)
at eval (route-loader.js?7e94:215:51)
I tried to sign in using another Google account, tried different Google client credentials, updated Amplify auth and went through all the settings. Still nothing worked. I then checked the cloud watch logs. Nothing...
Any idea what's happening?
Log output
// Put your logs below this line
[DEBUG] 25:10.892 AuthClass - Error in cognito hosted auth response Error: Internal+server+error.+
at OAuth.eval (OAuth.js?ca4e:244:1)
at step (OAuth.js?ca4e:55:1)
at Object.eval [as next] (OAuth.js?ca4e:36:46)
at eval (OAuth.js?ca4e:30:1)
at new Promise (<anonymous>)
at __awaiter (OAuth.js?ca4e:26:1)
at OAuth.handleAuthResponse (OAuth.js?ca4e:220:1)
at AuthClass.eval (Auth.js?134d:2271:1)
at step (Auth.js?134d:55:1)
at Object.eval [as next] (Auth.js?134d:36:46)
at eval (Auth.js?134d:30:1)
at new Promise (<anonymous>)
at __awaiter (Auth.js?134d:26:1)
at AuthClass._handleAuthResponse (Auth.js?134d:2233:1)
at eval (Auth.js?134d:229:1)
at eval (urlListener.js?d88e:17:1)
at AuthClass.configure (Auth.js?134d:223:24)
at eval (Amplify.js?b2f6:84:1)
at Array.map (<anonymous>)
at AmplifyClass.configure (Amplify.js?b2f6:83:1)
at eval (configureAmplify.js?89ed:10:1)
at ./configureAmplify.js (_app.js?ts=1660301705941:34680:1)
at options.factory (webpack.js?ts=1660301705941:698:31)
at __webpack_require__ (webpack.js?ts=1660301705941:37:33)
at fn (webpack.js?ts=1660301705941:353:21)
at eval (_app.js:12:75)
at ./pages/_app.js (_app.js?ts=1660301705941:35758:1)
at options.factory (webpack.js?ts=1660301705941:698:31)
at __webpack_require__ (webpack.js?ts=1660301705941:37:33)
at fn (webpack.js?ts=1660301705941:353:21)
at eval (?9413:5:16)
at eval (route-loader.js?7e94:215:51)
instrument.js?1ea2:109 [DEBUG] 25:10.893 Hub - Dispatching to auth with
{event: 'signIn_failure', data: Error: Internal+server+error.+
at OAuth.eval (webpack-internal:///./node_modules/.pnpm/#aws-amp…, message: 'The OAuth response flow failed'}
data: Error: Internal+server+error.+ at OAuth.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:255:35) at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:66:23) at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:47:53) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:41:71) at new Promise (<anonymous>) at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:37:12) at OAuth.handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:231:16) at AuthClass.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2285:65) at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:69:23) at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:50:53) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:44:71) at new Promise (<anonymous>) at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:40:12) at AuthClass._handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2247:16) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:243:23) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/urlListener.js:19:9) at AuthClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:237:69) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:90:18) at Array.map (<anonymous>) at AmplifyClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:89:26) at eval (webpack-internal:///./configureAmplify.js:14:59) at ./configureAmplify.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:34680:1) at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31) at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33) at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21) at eval (webpack-internal:///./pages/_app.js:12:75) at ./pages/_app.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:35758:1) at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31) at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33) at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21) at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=private-next-pages%2F_app&page=%2F_app!:5:16) at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/client/route-loader.js:247:16)
message: "Internal+server+error.+"
stack: "Error: Internal+server+error.+\n at OAuth.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:255:35)\n at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:66:23)\n at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:47:53)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:41:71)\n at new Promise (<anonymous>)\n at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:37:12)\n at OAuth.handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:231:16)\n at AuthClass.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2285:65)\n at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:69:23)\n at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:50:53)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:44:71)\n at new Promise (<anonymous>)\n at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:40:12)\n at AuthClass._handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2247:16)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:243:23)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/urlListener.js:19:9)\n at AuthClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:237:69)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:90:18)\n at Array.map (<anonymous>)\n at AmplifyClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:89:26)\n at eval (webpack-internal:///./configureAmplify.js:14:59)\n at ./configureAmplify.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:34680:1)\n at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31)\n at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33)\n at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21)\n at eval (webpack-internal:///./pages/_app.js:12:75)\n at ./pages/_app.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:35758:1)\n at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31)\n at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33)\n at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21)\n at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=private-next-pages%2F_app&page=%2F_app!:5:16)\n at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/client/route-loader.js:247:16)"
[[Prototype]]: Object
event: "signIn_failure"
message: "The OAuth response flow failed"
[[Prototype]]: Object
[DEBUG] 25:10.894 Hub - Dispatching to auth with
{event: 'cognitoHostedUI_failure', data: Error: Internal+server+error.+
at OAuth.eval (webpack-internal:///./node_modules/.pnpm/#aws-amp…, message: 'A failure occurred when returning to the Cognito Hosted UI'}
data: Error: Internal+server+error.+ at OAuth.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:255:35) at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:66:23) at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:47:53) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:41:71) at new Promise (<anonymous>) at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:37:12) at OAuth.handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:231:16) at AuthClass.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2285:65) at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:69:23) at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:50:53) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:44:71) at new Promise (<anonymous>) at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:40:12) at AuthClass._handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2247:16) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:243:23) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/urlListener.js:19:9) at AuthClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:237:69) at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:90:18) at Array.map (<anonymous>) at AmplifyClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:89:26) at eval (webpack-internal:///./configureAmplify.js:14:59) at ./configureAmplify.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:34680:1) at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31) at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33) at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21) at eval (webpack-internal:///./pages/_app.js:12:75) at ./pages/_app.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:35758:1) at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31) at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33) at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21) at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=private-next-pages%2F_app&page=%2F_app!:5:16) at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/client/route-loader.js:247:16)
message: "Internal+server+error.+"
stack: "Error: Internal+server+error.+\n at OAuth.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:255:35)\n at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:66:23)\n at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:47:53)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:41:71)\n at new Promise (<anonymous>)\n at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:37:12)\n at OAuth.handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/OAuth/OAuth.js:231:16)\n at AuthClass.eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2285:65)\n at step (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:69:23)\n at Object.eval [as next] (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:50:53)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:44:71)\n at new Promise (<anonymous>)\n at __awaiter (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:40:12)\n at AuthClass._handleAuthResponse (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:2247:16)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:243:23)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/urlListener.js:19:9)\n at AuthClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+auth#4.6.1/node_modules/#aws-amplify/auth/lib-esm/Auth.js:237:69)\n at eval (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:90:18)\n at Array.map (<anonymous>)\n at AmplifyClass.configure (webpack-internal:///./node_modules/.pnpm/#aws-amplify+core#4.6.1/node_modules/#aws-amplify/core/lib-esm/Amplify.js:89:26)\n at eval (webpack-internal:///./configureAmplify.js:14:59)\n at ./configureAmplify.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:34680:1)\n at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31)\n at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33)\n at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21)\n at eval (webpack-internal:///./pages/_app.js:12:75)\n at ./pages/_app.js (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1660301705941:35758:1)\n at options.factory (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:698:31)\n at __webpack_require__ (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:37:33)\n at fn (http://localhost:3000/_next/static/chunks/webpack.js?ts=1660301705941:353:21)\n at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=private-next-pages%2F_app&page=%2F_app!:5:16)\n at eval (webpack-internal:///./node_modules/.pnpm/next#12.2.2_cqi3zzjnvb643o7ixnrzsbv4xq/node_modules/next/dist/client/route-loader.js:247:16)"
[[Prototype]]: Object
event: "cognitoHostedUI_failure"
message: "A failure occurred when returning to the Cognito Hosted UI"
[DEBUG] 25:11.230 AuthClass - getting current authenticated user
instrument.js?1ea2:109 [DEBUG] 25:11.236 AuthClass - get current authenticated userpool user
instrument.js?1ea2:109 [DEBUG] 25:11.237 AuthClass - Failed to get user from user pool
instrument.js?1ea2:109 [DEBUG] 25:11.237 AuthClass - The user is not authenticated by the error No current user
[DEBUG] 25:11.238 Credentials - removing aws-amplify-federatedInfo from storage
instrument.js?1ea2:109 [DEBUG] 25:11.238 AuthClass - no current Cognito user
instrument.js?1ea2:109 [DEBUG] 25:11.238 Hub - Dispatching to auth with
{event: 'signOut', data: null, message: 'A user has been signed out'}
data: null
event: "signOut"
message: "A user has been signed out"
[[Prototype]]: Object

Related

Process not defined in node modules

Can anyone help me solve this error I get in my console when I run a ReactJS project
Uncaught ReferenceError: process is not defined
at ./node_modules/mysql/node_modules/readable-stream/lib/_stream_writable.js (_stream_writable.js:57:1)
at options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/mysql/node_modules/readable-stream/readable-browser.js (readable-browser.js:4:1)
at options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/mysql/lib/protocol/sequences/Query.js (Query.js:7:1)
at options.factory (react refresh:6:1)
I have tried npm i -D react-error-overlay#6.0.9 and npm i process

Error while integrating peerjs with nuxtjs (vue.js)

installing:
npm i peerjs
/plugins/peerjs.js
import Peer from 'peerjs'
export default Peer
nuxt.config.js
plugins: [
{ src: "~/plugins/peerjs.js", ssr: true }
],
Browser error:
client.js?06a0:103 TypeError: Cannot set properties of undefined
(setting '_events')
at i (peerjs.min.js?a0bc:46)
at i (peerjs.min.js?a0bc:66)
at _callee2$ (index.js?f26e:87)
at tryCatch (runtime.js?96cf:63)
at Generator.invoke [as _invoke] (runtime.js?96cf:294)
at Generator.eval [as next] (runtime.js?96cf:119)
at asyncGeneratorStep (asyncToGenerator.js?1da1:3)
at _next (asyncToGenerator.js?1da1:25)
_callee$ # client.js?06a0:103 tryCatch # runtime.js?96cf:63 invoke # runtime.js?96cf:294 eval # runtime.js?96cf:119 asyncGeneratorStep #
asyncToGenerator.js?1da1:3
_next # asyncToGenerator.js?1da1:25 eval # asyncToGenerator.js?1da1:32 eval # asyncToGenerator.js?1da1:21 eval # client.js?06a0:65
Promise.catch (asíncrono) eval # client.js?06a0:115 eval #
client.js:1294 ./.nuxt/client.js # app.js:35
webpack_require # runtime.js:854 fn # runtime.js:151 0 # app.js:9767
webpack_require # runtime.js:854 checkDeferredModules # runtime.js:46 webpackJsonpCallback # runtime.js:33 (anónimo) #
app.js:1
Setting { src: '~/plugins/peerjs.js' , mode: 'server'} fixed the issue.
Strange since it should either be mode: 'client' as shown in the documentation but I guess that PeerJS relies in fact on Node and not on client's window.

Require is not defined when importing #project-serum/anchor

I'm trying to import #project-serum/anchor to a Vue 3 project, with
import * as anchor from '#project-serum/anchor';
The project compiles fine, but when the component loads it throws an error:
VM28957:1 Uncaught (in promise) ReferenceError: require is not defined
at eval (eval at nodeWrap (sha256.js?6c27:1), <anonymous>:1:1)
at nodeWrap (sha256.js?6c27:83)
at createMethod (sha256.js?6c27:67)
at eval (sha256.js?6c27:501)
at Object.eval (sha256.js?6c27:518)
at eval (sha256.js:521)
at Object../node_modules/js-sha256/src/sha256.js (3.js:1335)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at Module.eval (common.js?789d:1)
I was able to solve this by setting window.JS_SHA256_NO_NODE_JS = true

ReferenceError: element is not defined .Facing this issue while I am trying to run test for ios in react native with jest as test runner

should have welcome heading
ReferenceError: element is not defined
5 | });
6 |
7 | it('should have welcome heading', async () => {
| ^
8 | await expect(element(by.id('InitialScreen'))).toBeVisible();
9 | });
10 | });
at _callee2$ (firstTest.spec.js:7:263)
at tryCatch (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:192:13)
detox[64341] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config=e2e/config.json --maxWorkers=1 '--te
stNamePattern=^((?!:android:).)*$' "./e2e/"
Downgrading to lower version of detox resolved the issue for me.

Aurelia and the dreaded commonJs.convert: COULD NOT CONVERT error

Background info:
Aurelia CLI
npm version 3.10.3
node version 6.7.0
Project was created and initially developed by me. Checked in to the customer's git repository. While I was assigned to other tasks, a couple of my co-workers continued working on the project. I'm now back working on this project and the first thing I did was a git pull. After updating my local copy of the source files, etc., I ran au build which produced the following error:
commonJs.convert: COULD NOT CONVERT:
C:/repos/xxxxxx/FrontEnd/src/selectedcustomer.js, so skipping it.
Error was: Error: Line 1: Unexpected token
{ uid: 8,
name: 'writeBundles',
branch: false,
error: { Error: Parse error using esprima for file: C:/repos/xxxxxx/FrontEnd/src/selectedcustomer.js
Error: Line 1: Unexpected token
at Object.context.load (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodrotrace\lib\loade\Loader.js:379:19)
at Object.load (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0),<anonymous>:832:29)
at Object.fetch (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:822:66)
at Object.check (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:854:30)
at Object.enable (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1173:22)
at Object.enable (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1554:39)
at Object.context.enable (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:289:24)
at Object.eval (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0),<anonymous>:1158:33)
at eval (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:134:23)
at each (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:59:31)
moduleTree: [ 'app' ],
fileName: 'C:/repos/xxxxxx/FrontEnd/src/app.js' },
duration: [ 0, 514590053 ],
time: 1486381456095
}
{ uid: 0,
name: '<series>',
branch: true,
error: { Error: Parse error using esprima for file: C:/repos/xxxxxx/FrontEnd/src/selectedcustomer.js
Error: Line 1: Unexpected token
at Object.context.load (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:379:19)
at Object.load (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:832:29)
at Object.fetch (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:822:66)
at Object.check (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:854:30)
at Object.enable (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1173:22)
at Object.enable (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1554:39)
at Object.context.enable (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:289:24)
at Object.eval (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1158:33)
at eval (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:134:23)
at each (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:59:31)
moduleTree: [ 'app' ],
fileName: 'C:/repos/xxxxxx/FrontEnd/src/app.js' },
duration: [ 11, 848277505 ],
time: 1486381456113 }
{ Error: Parse error using esprima for file: C:/repos/xxxxxx/FrontEnd/src/selectedcustomer.js
Error: Line 1: Unexpected token
at Object.context.load (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:379:19)
at Object.load (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:832:29)
at Object.fetch (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:822:66)
at Object.check (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:854:30)
at Object.enable (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1173:22)
at Object.enable (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1554:39)
at Object.context.enable (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:289:24)
at Object.eval (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:1158:33)
at eval (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0), <anonymous>:134:23)
at each (eval at <anonymous> (C:\repos\xxxxxx\FrontEnd\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:1:0),<anonymous>:59:31)
moduleTree: [ 'app' ],
fileName: 'C:/repos/xxxxxx/FrontEnd/src/app.js' }
Is there someone out there who knows what could be causing this? It builds on my co-workers machines so I'm genuinely at loss as to why I get this error. Also, as long as this isn't resolved I'm not able to work on the project, something my customer isn't too happy about.
Btw, I have tried npm install to no avail.
TIA
--norgie