vitest: Node Error FATAL ERROR: v8::FromJust Maybe value is Nothing, on Windows (local) and CI build (Linux)
Describe the bug
Running “npx vitest run” results in a Node error that repro’s about half the time. Usually, all the tests are reported as passing before Node spits out this error. The error appears for me locally on Windows 10, but also causes our Linux (Ubuntu) CI build to fail. My viteconfig file is pretty vanilla, the only slightly abnormal thing I’m using is scss additionalData. I am trying my best to get a sandboxed reproduction, but this is for a corporate project so I am unable to share my full repo. I understand that a full sandbox is required for the bug to be addressed, but I am desperate and confused, and am hoping someone might be able to at least point me in the right direction. I love vite and vitest and this is the last thing preventing me from getting my team onto it.
Below is the output I am seeing:
√ src/scenes/App/advanced-reporting/advanced-reporting-list-view/advanced-reporting-list-view.test.tsx (2 tests) 443ms √ src/components/create-quick-topic-report-modal/create-quick-topic-report-modal.test.tsx (5 tests) 949ms √ src/components/workplace-reactions-aggregate-card/workplace-reactions-aggregate-card.test.tsx (10 tests ) 1002ms FATAL ERROR: v8::FromJust Maybe value is Nothing.
Test Files 6 passed (6) Tests 33 passed (33) Time 17.04s (in thread 2.95s, 577.09%)
1: 00007FF60749815F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079 2: 00007FF6074254C6 DSA_meth_get_flags+65542 3: 00007FF60742637D node::OnFatalError+301 4: 00007FF607D46415 v8::V8::FromJustIsNothing+53 5: 00007FF6073423FA v8::internal::MicrotaskQueue::microtasks_policy+22170 6: 00007FF60734229D v8::internal::MicrotaskQueue::microtasks_policy+21821 7: 00007FF6072B2BAD v8::internal::OrderedHashTablev8::internal::OrderedNameDictionary,3::NextTableOffset +58157 8: 00007FF6072B0623 v8::internal::OrderedHashTablev8::internal::OrderedNameDictionary,3::NextTableOffset +48547 9: 00007FF6072B37CD v8::internal::OrderedHashTablev8::internal::OrderedNameDictionary,3::NextTableOffset +61261 10: 00007FF6074962E5 v8::internal::CodeObjectRegistry::~CodeObjectRegistry+106277 11: 00007FF60747E899 v8::internal::CodeObjectRegistry::~CodeObjectRegistry+9433 12: 00007FF6074EC4A8 uv_check_init+120 13: 00007FF6074F7168 uv_run+664 14: 00007FF6074C5E05 node::SpinEventLoop+309 15: 00007FF60735DEC0 v8::internal::interpreter::BytecodeLabel::bind+35776 16: 00007FF607359518 v8::internal::interpreter::BytecodeLabel::bind+16920 17: 00007FF6074E766D uv_poll_stop+557 18: 00007FF608300940 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+146416 19: 00007FFD49347034 BaseThreadInitThunk+20 20: 00007FFD4A282651 RtlUserThreadStart+33
Reproduction
run “npx vite run” on Windows 10 with the following vite config (changing scss additional data to pull in a scss file of your choosing)
/// <reference types="vitest" /> import { defineConfig, splitVendorChunkPlugin } from “vite”; import { inspectorServer } from “react-dev-inspector/plugins/vite”; import react from “@vitejs/plugin-react”;
export default defineConfig({
test: {
globals: true,
environment: “jsdom”,
},
plugins: [
react(),
splitVendorChunkPlugin(),
],
css: {
preprocessorOptions: {
scss: {
additionalData: @use "sass:math"; @import "scss/_aw-tools-and-vars-complete";
}
}
},
server: {
port: 8080,
strictPort: true,
},
build: {
sourcemap: true,
}
}
);
System Info
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 13.13 GB / 31.83 GB
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 100.0.4896.127
Edge: Spartan (44.19041.1266.0), Chromium (100.0.1185.50)
Internet Explorer: 11.0.19041.1202
npmPackages:
@vitejs/plugin-react: 1.3.1 => 1.3.1
vite: 2.9.5 => 2.9.5
vitest: 0.10.0 => 0.10.0
Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 11
- Comments: 23 (9 by maintainers)
Commits related to this issue
- fix(UseDraggable): add prop key[storageType] (#1191) [useDraggable.component] props is missing a key(storageType),This causes storage to remain localStorage — committed to chaii3/vitest by donotloveshampo 2 years ago
The fix is listed in v16.17.0 proposal, scheduled for August 16th.
The fix for v14 was already backported, and available on staging. Probably will be publically available with the next security release.
Under “Semver-patch commits”:
Here’s an example where it happened on Node 18: https://github.com/fwouts/previewjs/runs/7225194827?check_suite_focus=true
I’m also seeing this on vitest 0.17.0 (ubuntu-latest on GitHub Actions).
Still happening on vitest 0.12.6 (Windows 10) for me.
it’s looking good so far! I will run a few more CI builds tomorrow to validate but I think you got it! Thank you so much!
Per https://github.com/nodejs/node/issues/43617#issuecomment-1170545990, using Node 18 in my GitHub workflow resolved the issue.
I’m seeing this on Mac OS 12.4 too
If I run the test again after receiving this error, it will usually run without error on the 2nd or 3rd attempt
Node v16.15.0 Vitejs v3.0.0 Vitest v0.18.0
50/50 Getting these unhandled rejection errors both locally and on a WoodpeckerCI server even though my tests are shown to still pass.
Seeing this occasionally also, sometimes appears once a test fails. Main issue this is causing my CI to not think the test failed and keeps on with the rest of the stages.