René's URL Explorer Experiment


Title: Crash in cjs_lexer::Parse since v24.14.0: FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal · Issue #63323 · nodejs/node · GitHub

Open Graph Title: Crash in cjs_lexer::Parse since v24.14.0: FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal · Issue #63323 · nodejs/node

X Title: Crash in cjs_lexer::Parse since v24.14.0: FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal · Issue #63323 · nodejs/node

Description: Version v24.14.0 Platform We have only reproduced this on GitHub Actions ubuntu-latest runners so far (Linux x64, in CI). Subsystem No response What steps will reproduce the bug? We don't have a deterministic single-file repro: the empty...

Open Graph Description: Version v24.14.0 Platform We have only reproduced this on GitHub Actions ubuntu-latest runners so far (Linux x64, in CI). Subsystem No response What steps will reproduce the bug? We don't have a de...

X Description: Version v24.14.0 Platform We have only reproduced this on GitHub Actions ubuntu-latest runners so far (Linux x64, in CI). Subsystem No response What steps will reproduce the bug? We don't have ...

Opengraph URL: https://github.com/nodejs/node/issues/63323

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash in cjs_lexer::Parse since v24.14.0: FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal","articleBody":"### Version\n\nv24.14.0\n\n### Platform\n\nWe have only reproduced this on GitHub Actions `ubuntu-latest` runners so far (Linux x64, in CI).\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nWe don't have a deterministic single-file repro: the empty `MaybeLocal` only surfaces under heavy concurrent ESM→CJS preparse, and we couldn't isolate which specific allocation fails. The original environment is a Vite + Ladle dev server pair started by Playwright's `webServer` option, where each child process imports a large dependency graph on cold start.\n\nThe script below is the smallest standalone reproducer we could build that runs `node` only, no third-party deps. It is **probabilistic** — on our machine it aborts within a few thousand iterations, on a faster machine you may need to raise `N_WORKERS` / `N_FILES`. It exercises the same code path (`cjsPreparseModuleExports` → `cjs_lexer.parse`) under similar pressure to the real failure.\n\n````js\n// repro.mjs — run: `node repro.mjs` on Node \u003e= v24.14.0\n// No third-party deps. Aborts probabilistically with the same FATAL.\nimport { Worker, isMainThread, workerData } from 'node:worker_threads';\nimport { mkdtempSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nconst N_FILES = 500;\nconst N_WORKERS = 16;\n\nif (isMainThread) {\n  const dir = mkdtempSync(join(tmpdir(), 'cjs-lexer-repro-'));\n  const files = [];\n  for (let i = 0; i \u003c N_FILES; i++) {\n    const p = join(dir, `m${i}.cjs`);\n    // Many exports per file, mixing ASCII and non-ASCII to exercise both\n    // CreateString branches (NewFromOneByte / NewFromUtf8).\n    const body = Array.from({ length: 64 }, (_, k) =\u003e\n      `exports.a${i}_${k} = ${k};\\nexports.u${i}_${k} = 'あ${k}';`,\n    ).join('\\n');\n    writeFileSync(p, body);\n    files.push(pathToFileURL(p).href);\n  }\n  for (let w = 0; w \u003c N_WORKERS; w++) {\n    new Worker(new URL(import.meta.url), { workerData: { files } });\n  }\n} else {\n  await Promise.all(workerData.files.map((f) =\u003e import(f)));\n}\n````\n\nIf a maintainer can point us at a way to force `String::NewFromUtf8(..., kInternalized)` or `Set::Add()` to return empty `MaybeLocal` from user JS (e.g. via prototype accessors, à la #56531), we'd be happy to turn this into a deterministic regression test.\n\n### How often does it reproduce? Is there a required condition?\n\nProbabilistic.\n\n- Real environment (Vite dev server + Ladle dev server started concurrently by Playwright `webServer`): ~1 in 5–10 full `playwright test` runs aborts during cold start.\n- Standalone reproducer above: irregular, requires high `N_WORKERS` × `N_FILES`. May need tuning on faster machines.\n\nRequired conditions seem to be:\n\n- Node `\u003e= v24.14.0` (the version that switched from `cjs-module-lexer` (WASM) to `merve` (native) in #61456 / 68da144). Not reproducible on `v24.13.x`.\n- Multiple processes or worker threads concurrently doing ESM→CJS interop across many CJS files.\n\nPinning to Node `v24.13.1` makes the crash disappear in the real environment.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nIf V8 string creation or `Set::Add` returns an empty `MaybeLocal` (pending exception on the isolate, or allocation failure), `cjs_lexer::Parse` should propagate that as a JavaScript exception instead of aborting the process.\n\n`Parse` is invoked from `cjsPreparseModuleExports` in `lib/internal/modules/esm/translators.js`, which sits on a normal JS frame and can handle a thrown exception — at worst it would surface as a load failure for the affected module, which is recoverable, debuggable, and contained.\n\nThe current behavior — `OnFatalError` aborting the whole process — is too aggressive for this binding: it is on the hot path of every ESM import of a CJS module, and gives user code no recovery path. The previous WASM-based `cjs-module-lexer` did not have an equivalent fatal route here, so this is a regression in observable behavior, not only an implementation detail.\n\n### What do you see instead?\n\nThe process aborts immediately. No JS-level error is thrown, no `uncaughtException` / `unhandledRejection` / `process.on('exit')` handler fires. The child exit is observed only by the parent process (Playwright, in our case).\n\nOutput:\n\n```\nFATAL ERROR: v8::ToLocalChecked Empty MaybeLocal\n----- Native stack trace -----\n\n 1: 0x73f778 node::OnFatalError(char const*, char const*) [node]\n 2: 0xc06584  [node]\n 3: 0x8e7b85 node::cjs_lexer::Parse(v8::FunctionCallbackInfo\u003cv8::Value\u003e const\u0026) [node]\n 4: 0x7fb0abdcf08d\n\n----- JavaScript stack trace -----\n\n1: cjsPreparseModuleExports (node:internal/modules/esm/translators:393:44)\n2: createCJSModuleWrap (node:internal/modules/esm/translators:212:35)\n3: commonjsStrategy (node:internal/modules/esm/translators:349:10)\n4: #translate (node:internal/modules/esm/loader:451:20)\n5: afterLoad (node:internal/modules/esm/loader:507:29)\n6: loadAndTranslate (node:internal/modules/esm/loader:512:12)\n7: #getOrCreateModuleJobAfterResolve (node:internal/modules/esm/loader:555:36)\n8: afterResolve (node:internal/modules/esm/loader:603:52)\n9: getOrCreateModuleJob (node:internal/modules/esm/loader:609:12)\n10: syncLink (node:internal/modules/esm/module_job:162:33)\n```\n\n### Additional information\n\nThe native frame `node::cjs_lexer::Parse` corresponds to [`[src/node_cjs_lexer.cc](https://github.com/nodejs/node/blob/main/src/node_cjs_lexer.cc)`](https://github.com/nodejs/node/blob/main/src/node_cjs_lexer.cc), introduced in #61456 / [[68da144](https://github.com/nodejs/node/commit/68da144b4e)](https://github.com/nodejs/node/commit/68da144b4e) (replaced `cjs-module-lexer` with `merve`). Both `CreateString` and `Parse` contain unguarded `.ToLocalChecked()` calls:\n\n- L34: `String::NewFromOneByte(...).ToLocalChecked()` (in `CreateString`)\n- L41: `String::NewFromUtf8(...).ToLocalChecked()` (in `CreateString`)\n- L73: `exports_set-\u003eAdd(context, CreateString(...)).ToLocalChecked()` (in `Parse`)\n\nAll three return empty `MaybeLocal` whenever the isolate has a pending exception or string/handle allocation fails. The current code unconditionally dereferences via `ToLocalChecked()`, which calls `OnFatalError` and aborts.\n\n#### Suggested fix\n\nHave `CreateString` return `MaybeLocal\u003cString\u003e` and propagate failure from `Parse`. Empty `MaybeLocal` becomes a JS exception (the pending one on the isolate, in most cases) rather than a fatal abort:\n\n````cpp\ntemplate \u003ctypename T\u003e\ninline MaybeLocal\u003cString\u003e CreateString(Isolate* isolate, const T\u0026 str) {\n  std::string_view sv = lexer::get_string_view(str);\n  if (simdutf::validate_ascii(sv.data(), sv.size())) {\n    return String::NewFromOneByte(\n        isolate,\n        reinterpret_cast\u003cconst uint8_t*\u003e(sv.data()),\n        NewStringType::kInternalized,\n        static_cast\u003cint\u003e(sv.size()));\n  }\n  return String::NewFromUtf8(isolate,\n                             sv.data(),\n                             NewStringType::kInternalized,\n                             static_cast\u003cint\u003e(sv.size()));\n}\n\nvoid Parse(const FunctionCallbackInfo\u003cValue\u003e\u0026 args) {\n  // ... (head unchanged) ...\n\n  Local\u003cSet\u003e exports_set = Set::New(isolate);\n  for (const auto\u0026 exp : analysis.exports) {\n    Local\u003cString\u003e exp_str;\n    if (!CreateString(isolate, exp).ToLocal(\u0026exp_str)) return;\n    Local\u003cSet\u003e next_set;\n    if (!exports_set-\u003eAdd(context, exp_str).ToLocal(\u0026next_set)) return;\n    exports_set = next_set;\n  }\n\n  LocalVector\u003cValue\u003e reexports_vec(isolate);\n  reexports_vec.reserve(analysis.re_exports.size());\n  for (const auto\u0026 reexp : analysis.re_exports) {\n    Local\u003cString\u003e reexp_str;\n    if (!CreateString(isolate, reexp).ToLocal(\u0026reexp_str)) return;\n    reexports_vec.push_back(reexp_str);\n  }\n\n  Local\u003cValue\u003e result_elements[] = {\n      exports_set,\n      Array::New(isolate, reexports_vec.data(), reexports_vec.size())};\n  args.GetReturnValue().Set(Array::New(isolate, result_elements, 2));\n}\n````\n\nHappy to send a PR with this change plus a regression test, once we agree on the expected behavior (throw vs. silently return empty results) and a way to deterministically trigger empty `MaybeLocal` from JS for the test.\n\n#### Workaround\n\nPin to Node `v24.13.x` (last release before #61456). This makes the crash disappear in our environment.","author":{"url":"https://github.com/makimaki","@type":"Person","name":"makimaki"},"datePublished":"2026-05-15T05:55:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/63323/node/issues/63323"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e53024c7-5617-1850-009d-55b79cbfbc65
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB748:2BCCB3:60A766:8851D1:6A4D12B5
html-safe-nonce389025564b9468f6891bd6a9407dcb20bde3f0c73349c49d54a157fcb8f33628
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzQ4OjJCQ0NCMzo2MEE3NjY6ODg1MUQxOjZBNEQxMkI1IiwidmlzaXRvcl9pZCI6IjI4NTEzMzkxNjk2ODEyOTIwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb6d6cf4e227d620fb572a226ccd931026891f4e7051e834277d33a75c2f1fd17
hovercard-subject-tagissue:4451637643
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/63323/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c8a31dd5d0a095412c1d10b330c737f9cd23bd6858d8d630042b9c5b8dfb89cf/nodejs/node/issues/63323
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c8a31dd5d0a095412c1d10b330c737f9cd23bd6858d8d630042b9c5b8dfb89cf/nodejs/node/issues/63323
og:image:altVersion v24.14.0 Platform We have only reproduced this on GitHub Actions ubuntu-latest runners so far (Linux x64, in CI). Subsystem No response What steps will reproduce the bug? We don't have a de...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemakimaki
hostnamegithub.com
expected-hostnamegithub.com
Nonef02420044fa3730a0607f4a52546bdd73f5ae60187ef57d284ecb6d7f3f1d880
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef0b6a62c1f0be1086cb0b5b077b82cebe520eb42
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/issues/63323#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F63323
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F63323
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/63323
Reloadhttps://github.com/nodejs/node/issues/63323
Reloadhttps://github.com/nodejs/node/issues/63323
Please reload this pagehttps://github.com/nodejs/node/issues/63323
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/issues/63323
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.4k https://github.com/nodejs/node/issues
Pull requests 957 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
#63885https://github.com/nodejs/node/pull/63885
Crash in cjs_lexer::Parse since v24.14.0: FATAL ERROR: v8::ToLocalChecked Empty MaybeLocalhttps://github.com/nodejs/node/issues/63323#top
#63885https://github.com/nodejs/node/pull/63885
https://github.com/makimaki
makimakihttps://github.com/makimaki
on May 15, 2026https://github.com/nodejs/node/issues/63323#issue-4451637643
#56531https://github.com/nodejs/node/issues/56531
build,deps: replace cjs-module-lexer with merve #61456https://github.com/nodejs/node/pull/61456
68da144https://github.com/nodejs/node/commit/68da144b4e478167150031ff1b192882d2dd145e
[src/node_cjs_lexer.cc](https://github.com/nodejs/node/blob/main/src/node_cjs_lexer.cc)https://github.com/nodejs/node/blob/main/src/node_cjs_lexer.cc
#61456https://github.com/nodejs/node/pull/61456
68da144https://github.com/nodejs/node/commit/68da144b4e
68da144b4ehttps://github.com/nodejs/node/commit/68da144b4e
#61456https://github.com/nodejs/node/pull/61456
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.