Timeout before emulator launches the app , and instrumentationProcess terminated due to receipt of signal null - detox

When I run detox test, my app is getting installed in the android emulator, and then getting error :
instrumentationProcess terminated due to receipt of signal null
1) "before all" hook
0 passing (2m)
1 failing
1) "before all" hook:
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
child_process.js:635
throw err;
^
Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose
at checkExecSyncError (child_process.js:592:13)
at Object.execSync (child_process.js:632:13)
at runMocha (/Users/housing/housing-app/node_modules/detox/local-cli/detox-test.js:56:6)
at Object. (/Users/housing/housing-app/node_modules/detox/local-cli/detox-test.js:36:5)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
I am using : Detox version - 5.10.0 ,
react-native - 0.44.0 , Node - v8.6.0 , Device - android emulator , macOS - Sierra
How i can resolve this? Any suggestions...

This code defect is addressed by https://github.com/wix/detox/issues/407

Related

Cyclic.sh is not detecting the start scrypt in package.json

I came here after some hours of reading and getting into the cyclic cool deployment process. https://www.cyclic.sh/
I was trying to host my express js app for free and linked my github repo to my cyclic.sh dashboard. (I added typescript to my express app btw) The build process of my app was successful ✅ , but when I check the logs on runtime it throws me this error: ERROR: Failed to run 'node index.js'
Successful build:
enter image description here
The complete error log in runtime:
2023-01-09 01:21:26.063: grep: /var/task/package.json: No such file or directory
2023-01-09 01:21:26.527: node:internal/modules/cjs/loader:998
throw err;
^
Error: Cannot find module 'dotenv'
Require stack:
- /var/task/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/var/task/index.js:33:34)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/var/task/index.js' ]
}
Thrown at:
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
2023-01-09 01:21:26.527: at require (node:internal/modules/cjs/helpers:103:18)
at /var/task/index.js:33:34
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at executeUserEntryPoint (node:internal/modules/run_main:81:12)
Node.js v18.12.1
2023-01-09 01:21:26.562:
ERROR: Failed to run 'node index.js'.
Exited with code: 1
I noticed that the problem is that cyclic is not running node in the correct directory. The correct command executed should be: node dist/index.js. Because of that, I added the scripts configuration in my package.json as it is specified in https://docs.cyclic.sh/overview/launch, but for some reason cyclic is not reading that change in my scripts. (It works well locally)
I am not sure if I am missing something. I am very close, but I am stock at this point. I attatched some screenshots about the successful build, the failure and my package.json configuration.
My package.json file configuration:
enter image description here
Any help would be very appreaciated! Thanks in advance!

Error being displayed while setting up react native development environment

After typing 'npm start' instead of getting QR code on the terminal I am getting a 'UnhandledPromiseRejectionWarning' error. Can please someone help me resolve this? I am a beginner at this so I dont know the meaning of errors being displayed
C:\Users\DELL\Desktop\project> npm run android
> project#1.0.0 android C:\Users\DELL\Desktop\project
> expo start --android
(node:3460) UnhandledPromiseRejectionWarning: Error: Cannot find module 'fs/promises'
Require stack:
- C:\Users\DELL\Desktop\project\node_modules\#expo\cli\build\src\start\doctor\typescript\TypeScriptProjectPrerequisite.js
- C:\Users\DELL\Desktop\project\node_modules\#expo\cli\build\src\start\startAsync.js
- C:\Users\DELL\Desktop\project\node_modules\#expo\cli\build\src\start\index.js
- C:\Users\DELL\Desktop\project\node_modules\#expo\cli\build\bin\cli
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:962:15)
at Function.Module._load (internal/modules/cjs/loader.js:838:27)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\DELL\Desktop\project\node_modules\#expo\cli\build\src\start\doctor\typescript\TypeScriptProjectPrerequisite.js:5:40)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\DELL\Desktop\project\node_modules\#expo\cli\build\src\start\startAsync.js:15:38)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either
by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
PS C:\Users\DELL\Desktop\project>

Error when starting metro server in Vscode

When I try to start metro server using yarn start, this error comes:
PS C:\Users\SAMSUNG\Desktop\myApp> yarn start
yarn run v1.22.17
warning ..\..\..\package.json: No license field
$ react-native start
error Cannot read properties of undefined (reading 'split').
TypeError: Cannot read properties of undefined (reading 'split')
at toIdentifier (C:\Users\SAMSUNG\Desktop\myApp\node_modules\toidentifier\index.js:26:6)
at forEachCode (C:\Users\SAMSUNG\Desktop\myApp\node_modules\http-errors\index.js:267:16)
at Array.forEach (<anonymous>)
at populateConstructorExports (C:\Users\SAMSUNG\Desktop\myApp\node_modules\http-errors\index.js:265:9)
at Object.<anonymous> (C:\Users\SAMSUNG\Desktop\myApp\node_modules\http-errors\index.js:31:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What is wrong?
PS: It was working before without any problem. I upgraded all the node modules inside project and also react-native version, and this error started to happen. I didn't do anything to node.js, it is the same as before(v16.14.0).

Any npm command returns error "Cannot find module yallist" even npm -v

(node:2564) UnhandledPromiseRejectionWarning: Error: Cannot find module 'yallist'
Require stack:
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\lru-cache\index.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\range.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\comparator.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\semver\index.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\23354\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (C:\Users\23354\AppData\Roaming\npm\node_modules\npm\node_modules\lru-cache\index.js:4:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2564) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error
originated either by throwing inside of an async function without a catch block, or by
rejecting a promise which was not handled with .catch(). To terminate the node process
on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see
https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2564) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated.
In the future, promise rejections that are not handled will terminate the Node.js
process with a non-zero exit code.
I solved this by uninstalling node, and deleting the npm folder in the Roaming folder, then restarted the computer.
After that I installed node again. Everything is working now.
I occurred this problem while yarn build, what I have done the solve the problem are:
rm -rf node_modules
yarn install
yarn build
Btw, my node version is v14.18.1 and I have tried to remove yarn.lock but not worked.

New ReactNative App Triggers Bundler Error: error Unexpected token =

Every time I try to create a new React Native app, I receive this error in the Metro Bundler:
error Unexpected token =.
/Users/lukeschoenberger/repos/PodApp/node_modules/metro-cache/src/stores/HttpStore.js:31
static HttpError = HttpError;
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/lukeschoenberger/repos/PodApp/node_modules/metro-cache/src/stores/HttpGetStore.js:12:19)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
info Run CLI with --verbose flag for more details.
Process terminated. Press <enter> to close the window
I'm running: npx react-native run-ios.
When I create the script, I create the app, I run: npx react-native init AppName
I'm on node v14.17.1.
The startup script also says: success Successfully launched the app on the simulator
What am I doing wrong?
I had the same error because I was running on node v10.
After switching to node v14.17.5 (npm v6.14.14) via nvm, it solved the issue.
Can you verify you are really on v14.17.1?
For me, I tried using node v14.17.5 and it didn't work. I removed:
static HttpError = HttpError;
static NetworkError = NetworkError;
from node_modules/metro-config/node_modules/metro-cache/src/stores/HttpStore.js
and it worked.
Can use patch-package as well:
yarn patch-package metro-config/metro-cache