Getting nx format:write uncommitted failed without output and eslint --fix failed without output error when I do git commit - reactjs

Getting nx format:write --uncommitted failed and eslint --fix failed without output error when I try to do git commit
When I try to do git commit it is showing as below
Running tasks for staged files...
.lintstagedrc.json 1 file $schema no files [SKIPPED]
{apps, libs}/**/*. {ts, tsx, js, jsx) - 1 file * eslint-fix [KILLED]
.(ts, tsx, js, jsx, json, nd, arc) 1 file nx format:write -uncommitted [SIGSEGV] Skipped because of errors from tasks. [SKIPPED]
I
✓ Reverting to original state because of errors...
✓ Cleaning up temporary files...
*nx format:write -uncommitted failed without output (SIGSEGV).
eslint --fix failed without output

Related

A Problem occurred starting process 'command '../../node_modules/hermesvm/win64-bin/hermes

When i try to debug using the command react-native run-android --variant=betaDebug --appIdSuffix=prod it works perfectly fine. but when i tried to release a build using ./gradlew assembleBetaRelease this happens
Execution failed for task ':app:bundlereleasejsandassets'. > a problem occurred starting process 'command '../../node_modules/hermesvm/win64-bin/hermes
I tried making some changes in fixing the path, but still same error
project.ext.react = [
...some options...
enableHermes: true,
hermesCommand: "../../node_modules/hermesvm/%OS-BIN%/hermes"]
enter image description here

events.js:288 Error: write EPIPE when executing tests with Jest

I have a problem when setting React Testing Library into a new project, which is a project that generates common UI components for several projects. In one of the projects it is correctly setup, but when I added React Testing Library and updated dependencies in this project, I am able to run a test but not all of them.
If I do yarn test this is the result:
Test Suites: 8 passed, 8 of 33 total
Tests: 84 passed, 84 total
Snapshots: 0 total
Time: 28 sevents.js:288
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at ChildProcess.target._send (internal/child_process.js:806:20)
at ChildProcess.target.send (internal/child_process.js:677:19)
at ChildProcessWorker.send (C:\Users\user\workspace\project\node_modules\jest-worker\build\workers\ChildProcessWorker.js:291:17)
at WorkerPool.send (C:\Users\user\workspace\project\node_modules\jest-worker\build\WorkerPool.js:32:34)
at Farm._process (C:\Users\user\workspace\project\node_modules\jest-worker\build\Farm.js:129:10)
at Farm._enqueue (C:\Users\user\workspace\project\node_modules\jest-worker\build\Farm.js:152:10)
at Farm._push (C:\Users\user\workspace\project\node_modules\jest-worker\build\Farm.js:159:12)
at C:\Users\user\workspace\project\node_modules\jest-worker\build\Farm.js:90:14
at new Promise (<anonymous>)
at Farm.doWork (C:\Users\user\workspace\project\node_modules\jest-worker\build\Farm.js:56:12)
Emitted 'error' event on ChildProcess instance at:
at internal/child_process.js:810:39
at processTicksAndRejections (internal/process/task_queues.js:79:11) {
errno: 'EPIPE',
code: 'EPIPE',
syscall: 'write'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I tried doing rm -rf node_modules and then cleaning cache, and didn't work.
Any help?
It turns out that by changing some libraries in package.json the error dissapears:
Before (KO):
"babel-jest": "^24.9.0",
"jest": "^26.0.1",
After (OK):
"babel-jest": "^26.0.1",
"jest": "^25.5.4",
By doing yarn cache clean solved my problem. If you met pipe error similar like image below. I believe it is related to memory leaks.
In my case was the version of node. I had the version 15 (from Latest Features) and changed it to the stable version 14.17.3 (from LTS).
To know which version you have use node -v in a terminal.

fbt internationalization: ERROR in ./src/example/Example.react.js Module not found: Error: Can't resolve 'fbt'

I try to use new internationalization library from facebook - fbt, I follow by steps in doc:
git clone git#github.com:facebookincubator/fbt.git;
cd fbt/demo-app;
yarn install; # pull in dependencies
yarn manifest; # generate fbt enum manifests and source manifests
yarn collect-fbts; # Collect all fbt phrases from source
yarn translate-fbts; # Generate the translation payloads
yarn build;
yarn start; # Checkout your locally running server at localhost:8081
And in next I got next error on yarn build step:
ERROR in ./src/example/Example.react.js
Module not found: Error: Can't resolve 'fbt' in '/home/test/projects/fbt/demo-app/src/example'
# ./src/example/Example.react.js 36:0-80 37:0-4 100:17-31 104:18-29 113:6-23 141:9-12 143:43-46 145:43-46 159:10-27 164:15-29 165:9-12 168:15-29 169:9-12 172:15-29 173:9-12 176:15-29 177:9-12 185:21-24 198:21-24 219:15-29 220:9-12 223:15-29 224:9-12 227:15-29 228:9-12 231:15-29 232:9-12 236:9-12 238:10-13 240:58-61 243:9-12 246:10-13 256:21-24 289:15-26 290:9-12 293:15-26 294:9-12 297:15-26 298:9-12 301:15-26 302:9-12 305:15-26 306:9-12 309:15-26 310:9-12 314:9-12 340:10-13 344:32-35 344:78-81 346:9-12 346:27-30 348:9-12 352:12-15 362:9-12
# ./src/root.js
My apologies! It looks like we were missing a step in our documentation! You'll need to run yarn in the top-level first (to build the runtime library):
git clone git#github.com:facebookincubator/fbt.git;
cd fbt;
yarn;
cd demo-app
yarn ...

Karma unit testing webpack:API fatal error handler returned after process out of memory

I am trying to execute karma unit test cases for my project. When I run the whole test cases which are available in the application, it is failing with the below error. But when I configure to run fewer test cases by executing all the controllers in a folder, it works. How to increase the memory size to execute all the test cases.
Tried searching but couldn't get any working solutions. Any guidance would be helpful.`
$ karma start karma.conf.js
#
# Fatal error in , line 0
# API fatal error handler returned after process out of memory
#
/c/Users/AB18082/AppData/Roaming/npm/karma: line 14: 20164 Segmentation fault node "$basedir/node_modules/karma-cli/bin/karma" "$#"
EDIT 1:
When i try to increase size
$ node --max_old_space_size=10240 node_modules/karma/bin/karma start karma.conf.js
<--- Last few GCs --->
[13860:002BF998] 214803 ms: Scavenge 1021.9 (1358.6) -> 1021.6 (1365.1) MB, 146.9 / 0.0 ms allocation failure
[13860:002BF998] 217090 ms: Mark-sweep 1026.8 (1365.9) -> 1014.7 (1355.9) MB, 2263.4 / 0.0 ms allocation failure GC in old space requested
[13860:002BF998] 217243 ms: Scavenge 1022.6 (1359.5) -> 1022.5 (1363.5) MB, 75.4 / 0.0 ms allocation failure
[13860:002BF998] 217479 ms: Scavenge 1029.7 (1364.1) -> 1029.6 (1366.6) MB, 225.5 / 0.0 ms allocation failure
<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory
EDIT 2:
After setting those node --max_old_space_size=4096 changes my application itself is not loading now. tried uninstalling the nodejs and cleared
npm and npm-cache directories from %appdata% directory
Now getting these error when i start the application also.
FATAL ERROR: Committing semi space failed. Allocation failed - process out of memory
1: 00BF287E
2: 00FD3013
3: 00FD1B24
4: 00FD16FC
EDIT:3
After so much googling able to fix loading the application using the below cmd and still the testing is having the same issue.
env NODE_OPTIONS=--max_old_space_size=2048 node node_modules/webpack/bin/webpack
Your issue will resolve once you do changes in package.json like below
"scripts": {
"test": "node --max_old_space_size=4096 ./node_modules/karma/bin/karma start ./test-config/karma.conf.js",
"test-ci": "node --max_old_space_size=4096 ./node_modules/karma/bin/karma start ./test-config/karma.conf.js --single-run",
"test-coverage": "node --max_old_space_size=4096 ./node_modules/karma/bin/karma start ./test-config/karma.conf.js --coverage"
}

Babel/browserify throws "Error while parsing JSON - Unexpected token o"

Weird error when attempting to use browserify and babel:
./node_modules/.bin/browserify app/index.js -o bundle.js -t [ babelify --presets [ es2015 react ] ]
gives:
SyntaxError: /.../package.json: Error while parsing JSON - Unexpected token o in JSON at position 1 while parsing file: /.../index.js
at Object.parse (native)
at ConfigChainBuilder.addConfig (/.../dash/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:155:65)
at ConfigChainBuilder.findConfigs (/.../dash/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:107:30)
at buildConfigChain (/.../dash/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:66:13)
at OptionManager.init (/.../dash/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:369:58)
at File.initOptions (/.../dash/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:223:65)
at new File
I have the proper presets installed for es2015 and react, but I have no idea why it's throwing up this error. The weird thing is, this command is working on my production server...
Any ideas?
This is the package.json parsing error, Check whether there is an package.json file at my user directory, if exist, delete it.

Resources