mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
2aedd52ce6
Fixes #20525, (thanks @oxura !) ```sh # Many files that route to the Prettier `formatFile` callback and fail to parse mkdir -p /tmp/repro for i in $(seq 1 500); do printf '<template><div></template>' > /tmp/repro/broken$i.vue; done # Run repeatedly with default concurrency for run in $(seq 1 10); do node apps/oxfmt/dist/cli.js --write /tmp/repro; done ``` Within a few runs it crashes non-deterministically (exit codes varied: 133 / 138 / 139, and sometimes 2 = clean error report), with the same fatal as #20525: ``` # Fatal error in , line 0 # Check failed: object_ != kGlobalHandleZapValue. (or: node->IsInUse()) ... napi_reference_unref <napi::error::Error as ...Drop>::drop core::ptr::drop_in_place<napi::error::Error> oxfmt::core::external_formatter::wrap_format_file::{{closure}} ``` Each broken file makes the `formatFile` callback reject; the resulting `napi::Error` is dropped on the TSFN await path and reaches `napi_reference_unref` during teardown → V8 fatal check. After this fix (callback resolves errors as data), the same workload runs clean.
1.8 KiB
1.8 KiB