-
fix(core): add explicit exports entry for nx/src/native directory (#34967)
发布于
2026-03-23 23:03:28 +00:00 Current Behavior
After the nodenext PR (#34111) added an
exportsmap to
packages/nx/package.json, the nx-cloud light client (ocean) fails to
importnx/src/native.The wildcard exports pattern
"./src/*"resolvesnx/src/nativeto
./dist/src/native.js— but the actual file is
./dist/src/native/index.js(it's a directory with an index file).
Node's exports map does literal*substitution and does not
perform CJS-style directory/index resolution.The cloud client wraps all its nx imports in a single try/catch, so when
the native import fails,getDbConnectionis never assigned either,
causinggetDbConnection is not a functionerrors in CI.This was not an issue with
nx@22.7.0-beta.1because that version had
noexportsmap — Node fell back to normal CJS resolution which handles
directory/index lookups.Expected Behavior
require('nx/src/native')correctly resolves to
dist/src/native/index.jsvia an explicit export entry, and the cloud
client can load the native module andgetDbConnectionwithout errors.Related Issue(s)
N/A — discovered during version bump CI failure investigation.
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
下载附件