-
fix(core): preserve hydrateFileMap back-compat for cached nx-cloud workers (#35502)
发布于
2026-04-29 22:30:37 +00:00 Current Behavior
nx@23.0.0-beta.2Nx Cloud V4 distributed-agent workers crash on every
task with:Failed to get external value at new NativeTaskHasherImpl (.../native-task-hasher-impl.js:25:23) at new InProcessTaskHasher (.../task-hasher.js:68:27) at createTaskHasher (.../create-task-hasher.js:13:16) at createOrchestrator (.../init-tasks-runner.js:86:60) at runDiscreteTasks (.../init-tasks-runner.js:114:32) at executeAndStoreTask (.../discrete-task-worker.js:1:832861)#34425 ("remove redundant
allWorkspaceFilesfrom the project graph
pipeline") changed two helpers in
packages/nx/src/project-graph/build-project-graph.ts:hydrateFileMap(fileMap, allWorkspaceFiles, rustReferences)→
hydrateFileMap(fileMap, rustReferences)getFileMap()no longer returnsallWorkspaceFiles
Cached Nx Cloud V4 workers (e.g.
.nx/cache/cloud/2604.29.7/lib/core/runners/distributed-agent/v4/discrete-task-worker.js)
require('nx/src/project-graph/build-project-graph')directly and still
call the 3-arg form:hydrateFileMap( { projectFileMap, nonProjectFiles }, allWorkspaceFiles, // lands in rustReferences slot on beta.2 rustReferences // silently dropped );The
FileData[]array poisonsstoredRustReferences. Later
createTaskHasherreads.projectFiles/.allWorkspaceFilesoff the
array (bothundefined), passes them tonew TaskHasher(...), and
napi-rs throws"Failed to get external value"trying to coerce
undefinedinto&External<Arc<…>>.Expected Behavior
hydrateFileMapaccepts both the new 2-arg shape and the legacy 3-arg
shape, detected byArray.isArray()on the 2nd argument.getFileMap()
re-exposesallWorkspaceFiles: []so cached workers that destructure it
(for telemetry /v4log) see the property instead ofundefined. Both
surfaces are flagged@deprecatedso we can remove them in a later
major once cached V4 workers age out.A regression test pins both arities — verified red on the pre-fix code
and green with the fix.Related Issue(s)
下载附件