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 - react-native

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.

Related

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

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

Detox not working [Info.plist does not contain CFBundleShortVersionString]

package.json
"detox": {
"test-runner": "jest",
"configurations": {
"ios.sim": {
"build": "xcodebuild -workspace ios/lamunchies.xcworkspace -scheme lamunchies -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"binaryPath": "ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app",
"type": "ios.simulator",
"name": "iPhone 8"
}
}
}
firstTestSpecs.js
describe('Example', () => {
beforeEach(async () => {
await device.reloadReactNative()
})
it('should have welcome screen', async () => {
await expect(element(by.id('Settings'))).toBeVisible()
})
})
logs
detox[38188] ERROR: [exec.js/EXEC_FAIL, #3] An error was encountered processing the command (domain=NSPOSIXErrorDo
main, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
detox[38188] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
{ ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/j
ordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (/Users/jordeguevara/Desktop/LAMunchies/node_modules/child-process-promise/lib/index.js:33:27)
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
name: 'ChildProcessError',
code: 22,
childProcess:
{ ChildProcess: { [Function: ChildProcess] super_: [Function] },
fork: [Function: fork],
_forkChild: [Function: _forkChild],
exec: [Function: exec],
execFile: [Function: execFile],
spawn: [Function: spawn],
spawnSync: [Function: spawnSync],
execFileSync: [Function: execFileSync],
execSync: [Function: execSync] },
stdout: '',
stderr:
'An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe application\'s Info.plist does not contain CFBundleShortVersionString.\nEnsure your bundle contains a CFBundleShortVersionString.\n' }
Example: should have welcome screen
Example: should have welcome screen [FAIL]
FAIL e2e/firstTest.spec.js (6.516s)
Example
✕ should have welcome screen (4ms)
● Example › should have welcome screen
ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/......../ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/...../ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (../node_modules/child-process-promise/lib/index.js:33:27)
● Example › should have welcome screen
ReferenceError: device is not defined
1 | describe('Example', () => {
2 | beforeEach(async () => {
> 3 | await device.reloadReactNative()
| ^
4 | })
5 |
6 | it('should have welcome screen', async () => {
at _callee$ (firstTest.spec.js:3:11)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:192:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at Object.<anonymous>.exports.async (../node_modules/regenerator-runtime/runtime.js:216:14)
at Object._callee (firstTest.spec.js:2:14)
● Example › should have welcome screen
ReferenceError: element is not defined
4 | })
5 |
> 6 | it('should have welcome screen', async () => {
| ^
7 | await expect(element(by.id('Settings'))).toBeVisible()
8 | })
9 | })
at _callee2$ (firstTest.spec.js:6:36)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:192:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
at Object.<anonymous>.exports.async (../node_modules/regenerator-runtime/runtime.js:216:14)
at Object._callee2 (firstTest.spec.js:6:36)
detox[38187] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePat
tern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 62BBE686-316C-4D6E-9625-E8D21F60CE97 "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (../node_modules/child-process-promise/lib/index.js:33:27)
detox[37766] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePat
tern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
MacBook-Pro-9:LAMunchies jordeguevara$ detox test
detox[37982] INFO: [test.js] configuration="ios.sim" reportSpecs=true DETOX_START_TIMESTAMP=1579315003125 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
detox[37983] INFO: [DetoxServer.js] server listening on localhost:55101...
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] "/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/
Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"" f
ailed with code = 22, stdout and stderr:
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6]
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=NSPOSIXErrorDo
main, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
detox[37983] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
{ ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/j
ordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
`/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
at callback (/Users/jordeguevara/Desktop/LAMunchies/node_modules/child-process-promise/lib/index.js:33:27)
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
name: 'ChildProcessError',
code: 22,
childProcess:
{ ChildProcess: { [Function: ChildProcess] super_: [Function] },
fork: [Function: fork],
_forkChild: [Function: _forkChild],
exec: [Function: exec],
execFile: [Function: execFile],
spawn: [Function: spawn],
spawnSync: [Function: spawnSync],
execFileSync: [Function: execFileSync],
execSync: [Function: execSync] },
stdout: '',
stderr:
'An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe application\'s Info.plist does not contain CFBundleShortVersionString.\nEnsure your bundle contains a CFBundleShortVersionString.\n' }
I was trying to set up Detox on my reat native project via CLI but ran into some trouble.
I tried adding CFBundleShortVersionString to InfoList but it was already there.
I followed the steps to set up detox in this article : https://blog.expo.io/testing-expo-apps-with-detox-and-react-native-testing-library-7fbdbb82ac87
Any help would be appreciated
So hopefully this helps someone
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
it told me it my CFBundleShortVersionString already it existed but I just changed it to a different number in my Info.plist
and it worked from there

Protractor - unable to get URL title, webdriver just hangs

just start messing around with Protractor for an upcoming project that may require front-end automation on an angular based website. After installing Protractor and running the given examples, tried to do a very simple test, like the following:
// test.js
describe('Protractor Demo App', function() {
it('should have a title', function() {
browser.get('http://www.google.co.uk');
expect(browser.getTitle()).toEqual('Google');
});
});
Problem is, the browser opens but then it just hangs until it closes with an error:
Failures:
1) Protractor Demo App should have a title
Message:
Failed: Cannot read property 'ver' of null
Stack:
TypeError: Cannot read property 'ver' of null
at executeAsyncScript_.then (/usr/local/lib/node_modules/protractor/built/browser.js:716:56)
at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27)
at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7
at process.internalTickCallback (internal/process/next_tick.js:77:7)
From: Task: Run it("should have a title") in control flow
at UserContext.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:19)
From asynchronous test:
Error
at Suite.<anonymous> (/Users/rubensantos/Documents/protractor/test.js:3:5)
at Object.<anonymous> (/Users/rubensantos/Documents/protractor/test.js:2:1)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
1 spec, 1 failure
Finished in 4.056 seconds
[11:18:25] I/launcher - 0 instance(s) of WebDriver still running
[11:18:25] I/launcher - chrome #01 failed 1 test(s)
[11:18:25] I/launcher - overall: 1 failed spec(s)
[11:18:25] E/launcher - Process exited with error code 1
have no idea why this simple test does not work. Any help is welcome, thanks in advance
It would be a great decision to disable Control Flow due to this thread . In your protractor.conf.js file add SELENIUM_PROMISE_MANAGER: false line. After it you should resolve Promises by yourself. For example your test will look like:
describe('Protractor Demo App', function() {
it('should have a title', async function() {
await browser.get('http://www.google.co.uk');
expect(await browser.getTitle()).toEqual('Google');
});
});

"ReferenceError: device is not defined" when using detox+Jest in React Native for android

App is working fine both in Android and iOS simulators. I am trying to setup Detox with Jest for end to end testing my react-native app. In simulator I can see some movement but app is not launched and I get following errors(apart from "device not defined" I am also getting "app-debug-androidTest.apk: No such file or directory" error, so not sure what is the root cause here).
Console
>detox test --configuration android.emu.debug
node_modules/.bin/jest e2e --config=e2e/config.json --runInBand
server listening on localhost:64281...
(node:75639) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
console.log e2e/firstTest.spec.js:3
**********before each called
console.log e2e/firstTest.spec.js:9
***************first test
FAIL e2e/firstTest.spec.js (123.358s)
Example
✕ should have welcome screen (120009ms)
● Example › should have welcome screen
ChildProcessError: Command failed: /Users/xxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk
adb: failed to stat /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk: No such file or directory
`/Users/xxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/xxx/Projects/xxxxxx/android/app/build/outputs/apk/app-debug-androidTest.apk` (exited with error code 1)
at callback (../node_modules/child-process-promise/lib/index.js:33:27)
● Example › should have welcome screen
ReferenceError: device is not defined
2 | beforeEach(async () => {
3 | console.log('**********before each called');
> 4 | await device.reloadReactNative();
5 | console.log('**********before each end');
6 | });
7 |
at Object._callee$ (firstTest.spec.js:4:1)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
at ../node_modules/regenerator-runtime/runtime.js:195:11
at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
at Object.<anonymous>.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
at Object._callee (firstTest.spec.js:2:57)
● Example › should have welcome screen
Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.
at ../node_modules/jest-jasmine2/build/queue_runner.js:72:21
at Timeout.callback [as _onTimeout] (../node_modules/jsdom/lib/jsdom/browser/Window.js:592:19)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 123.919s, estimated 241s
Ran all test suites matching /e2e/i.
child_process.js:644
throw err;
^
Error: Command failed: node_modules/.bin/jest e2e --config=e2e/config.json --runInBand
at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at runJest (/Users/xxx/Projects/xxxxxx/node_modules/detox/local-cli/detox-test.js:69:6)
at Object.<anonymous> (/Users/xxx/Projects/xxxxxx/node_modules/detox/local-cli/detox-test.js:42:5)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
firstTest.spec.js:
describe('Example', () => {
beforeEach(async () => {
console.log('**********before each called');
await device.reloadReactNative();
console.log('**********before each end');
});
it('should have welcome screen', async () => {
console.log('***************first test');
await expect(element(by.id('welcome'))).toBeVisible();
console.log('***************first test end');
});
})
package.json
"dependencies": {
"react": "16.0.0",
"react-native": "0.51.0",
....
},
"devDependencies": {
"babel-jest": "22.0.3",
"babel-preset-react-native": "4.0.0",
"detox": "^6.0.4",
"jest": "22.0.3",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native",
"setupTestFrameworkScriptFile": "./e2e/init.js"
},
"detox": {
"specs": "e2e",
"test-runner": "jest",
"runner-config": "e2e/config.json",
"configurations": {
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/app-debug.apk",
"build": "pushd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && popd",
"type": "android.emulator",
"name": "Pixel_API_27"
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"name": "Pixel_API_27"
}
}
}
init.js
const detox = require('detox');
const config = require('../package.json').detox;
// Set the default timeout
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;
beforeAll(async () => {
await detox.init(config);
});
afterAll(async () => {
await detox.cleanup();
});
Following is the view while running the test command
I was able to solve the issue by following this example from detox. Followed the android project config and made some changes in app/build.gradle. Basically made it same as in the example code.
Waiting for detox to officially start supporting Android with clear setup steps. There are still issues while using gradle 3.

TypeError: 'undefined is not a function when' installing new keystonejs application

I am following this steps :
http://keystonejs.com/getting-started/
nodejs - v0.12.7
mongod - db version v3.2.0
but I am getting the error below
} if (userModelPath.includes('-')) { ;
^
TypeError: undefined is not a function
at eval (eval at template (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6306:22), <anonymous>:77:22)
at KeystoneGenerator.underscore [as _engine] (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/util/engines.js:31:45)
at KeystoneGenerator.engine (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/actions/actions.js:314:10)
at KeystoneGenerator.template (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/actions/actions.js:289:15)
at KeystoneGenerator.project (/usr/local/lib/node_modules/generator-keystone/app/index.js:320:7)
at /usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/base.js:395:14
at processImmediate [as _immediateCallback] (timers.js:367:17)
Sergius-MacBook-Pro:keystoneadmin sergiu$
You need to update your version of Node.js
String.prototype.includes() was most likely String.prototype.contains() in your version of Node.js