prettier: Fatal error when trying to format file

Environments:

  • Prettier Version: 2.6.2
  • Running Prettier via: CLI
  • Runtime: Node 16.14.0
  • Operating System: Windows WSL
  • Prettier plugins (if any): prettier-plugin-organize-imports, prettier-plugin-sh

Steps to reproduce:

Repro repository: https://github.com/oliversalzburg/prettier-repro

node node_modules/.bin/prettier --write subject.json

Expected behavior:

The file is formatted. Should be a noop, as it’s already formatted to comply.

Actual behavior:

FATAL ERROR: v8::FromJust Maybe value is Nothing.
 1: 0xb309a0 node::Abort() [node]
 2: 0xa4219e node::FatalError(char const*, char const*) [node]
 3: 0xd235da v8::Utils::ReportApiFailure(char const*, char const*) [node]
 4: 0xb352ed node::fs::FileHandle::CloseReq::Resolve() [node]
 5: 0xb35470  [node]
 6: 0x159f86d  [node]
 7: 0x15a4046  [node]
 8: 0x15b6774  [node]
 9: 0x15a4998 uv_run [node]
10: 0xa67dd5 node::SpinEventLoop(node::Environment*) [node]
11: 0xbfcfca node::worker::Worker::Run() [node]
12: 0xbfd478  [node]
13: 0x7f01bfd29609  [/lib/x86_64-linux-gnu/libpthread.so.0]
14: 0x7f01bfc50293 clone [/lib/x86_64-linux-gnu/libc.so.6]
[1]    990 abort      node node_modules/.bin/prettier --write subject.json

I have observed this yesterday already with another file and was not able to make sense of it.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (10 by maintainers)

Most upvoted comments

No, I have not yet tried your latest update. Thanks for pointing that out.

Besides, do not reopen the issue here, post a new one on https://github.com/rx-ts/prettier next time if you know which prettier plugin is related.

Bro, this is literally a question in my latest post. You don’t have to play smart with me wtf?

So, here’s more info.

First of all, I executed Prettier without going through yarn, same issue:

╰─ node ./node_modules/.bin/prettier --write packages/userscript/package.json
packages/userscript/package.json 24ms
FATAL ERROR: v8::FromJust Maybe value is Nothing.
 1: 0xb309a0 node::Abort() [node]
 2: 0xa4219e node::FatalError(char const*, char const*) [node]
 3: 0xd235da v8::Utils::ReportApiFailure(char const*, char const*) [node]
 4: 0xb352ed node::fs::FileHandle::CloseReq::Resolve() [node]
 5: 0xb35470  [node]
 6: 0x159f86d  [node]
 7: 0x15a4046  [node]
 8: 0x15b6774  [node]
 9: 0x15a4998 uv_run [node]
10: 0xa67dd5 node::SpinEventLoop(node::Environment*) [node]
11: 0xbfcfca node::worker::Worker::Run() [node]
12: 0xbfd478  [node]
13: 0x7f770c2f7609  [/lib/x86_64-linux-gnu/libpthread.so.0]
14: 0x7f770c21e293 clone [/lib/x86_64-linux-gnu/libc.so.6]
[1]    3801 abort      node ./node_modules/.bin/prettier --write packages/userscript/package.json

Then I removed prettier-plugin-sh from my config and ran again:

╰─ node ./node_modules/.bin/prettier --write packages/userscript/package.json
packages/userscript/package.json 29ms

No problem. So run again.

╰─ node ./node_modules/.bin/prettier --write packages/userscript/package.json
packages/userscript/package.json 25ms
FATAL ERROR: v8::FromJust Maybe value is Nothing.
 1: 0xb309a0 node::Abort() [node]
 2: 0xa4219e node::FatalError(char const*, char const*) [node]
 3: 0xd235da v8::Utils::ReportApiFailure(char const*, char const*) [node]
 4: 0xb352ed node::fs::FileHandle::CloseReq::Resolve() [node]
 5: 0xb35470  [node]
 6: 0x159f86d  [node]
 7: 0x15a4046  [node]
 8: 0x15b6774  [node]
 9: 0x15a4998 uv_run [node]
10: 0xa67dd5 node::SpinEventLoop(node::Environment*) [node]
11: 0xbfcfca node::worker::Worker::Run() [node]
12: 0xbfd478  [node]
13: 0x7f4aa9f87609  [/lib/x86_64-linux-gnu/libpthread.so.0]
14: 0x7f4aa9eae293 clone [/lib/x86_64-linux-gnu/libc.so.6]
[1]    4406 abort      node ./node_modules/.bin/prettier --write packages/userscript/package.json

I’ve had this a couple of times that some change would resolve the problem for a single run and then it’s back to failure. Sounds like some caching to me, but I don’t know what this could be.

The problem still reproduces after removing all plugins from the configuration.