Skip to content

FATAL ERROR: v8::FromJust Maybe value is Nothing. #2947

Closed
@hanspagel

Description

@hanspagel

Description

I’m currently migrating a test suite with ~100 tests from Mocha to AVA. Writing those tests is a breeze, but unfortunately the more tests I write, the more I run into the following exception:

FATAL ERROR: v8::FromJust Maybe value is Nothing.
 1: 0x10456b508 node::Abort() [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 2: 0x10456b690 node::errors::TryCatchScope::~TryCatchScope() [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 3: 0x1046bb6f4 v8::V8::FromJustIsNothing() [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 4: 0x104613920 node::ReportWritesToJSStreamListener::OnStreamAfterReqFinished(node::StreamReq*, int) [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 5: 0x10461397c node::ShutdownWrap::OnDone(int) [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 6: 0x104617dec node::LibuvStreamWrap::AfterUvShutdown(uv_shutdown_s*, int) [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 7: 0x104de2eb4 uv__stream_io [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 8: 0x104deaa24 uv__io_poll [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
 9: 0x104dd91a0 uv_run [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
10: 0x1044bbe00 node::SpinEventLoop(node::Environment*) [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
11: 0x1045fcd44 node::worker::Worker::Run() [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
12: 0x1045fff6c node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/Users/hanspagel/.nvm/versions/node/v16.13.2/bin/node]
13: 0x1972414ec _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
14: 0x19723c2d0 thread_start [/usr/lib/system/libsystem_pthread.dylib]
zsh: abort      npm run ava:watch

Additional details

In basically every test I’m booting a new WebSocket server, and connecting with a client. The WebSocket server is bound to port 0, which eventually is picking a random free high port.

The exception is thrown:

  • At random runs
  • With watch mode and without
  • Even with --concurreny 1
  • Also when TypeScript fails to compile in watch mode
  • On my M1 and on GitHub Actions (with Ubuntu)

Questions

Chances are I’m the bug here, or the way I write the tests. But I can’t really get anything from that error message.

  1. Is there a way to get better exceptions?
  2. Is there a way to get better stack traces or at least see which test is triggering it?
  3. Does the type of error indicate a field where I need to look into further?

Any help is appreciated.

Dependencies

package.json
{
  "type": "module",
  "ava": {
    "files": [
      "ava-tests/**/*",
      "!ava-tests/utils/**/*"
    ],
    "extensions": {
      "ts": "module"
    },
    "nodeArguments": [
      "--conditions=source",
      "--no-warnings",
      "--loader=ts-node/esm",
      "--experimental-specifier-resolution=node"
    ]
  },
  "scripts": {
    "ava": "ava",
    "ava:watch": "ava --watch"
  },
  "devDependencies": {
    "@ava/typescript": "^3.0.1",
    "ava": "^4.0.1",
    "ts-node": "^10.4.0",
    "typescript": "^4.5.4"
  }
}

I’m too stupid to get the AVA version (maybe because I’m working with npm workspaces), but it’s latest:

$ npx ava --version
unknown

$ node --version
v16.13.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions