Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hanspagel opened this issue Jan 17, 2022 · 3 comments
Closed

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

hanspagel opened this issue Jan 17, 2022 · 3 comments

Comments

@hanspagel
Copy link

hanspagel commented Jan 17, 2022

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
@novemberborn
Copy link
Member

I think this is a Node.js bug, there's not much we can do about it. Try disabling worker threads (--no-worker-threads on CLI or workerThreads: false in config).

ava --version is currently broken, see #2942.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

@hanspagel
Copy link
Author

Thanks @novemberborn, you’re amazing! Adding "workerThreads": false to my config helped. 👌

@stuft2
Copy link

stuft2 commented Apr 6, 2023

Ran into this issue today running ava configured for ESM, TypeScript v5.0.3, and Node v18.14.0. --no-worker-threads fixed the issue for me. Could be the same bug... @novemberborn is this bug being tracked in Node's issues? I can't find any open issues matching this error.

@avajs avajs locked and limited conversation to collaborators Apr 10, 2023
@novemberborn novemberborn converted this issue into discussion #3191 Apr 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants