Summary
import { TestRunner } from "@digital-alchemy/core/testing" throws ERR_MODULE_NOT_FOUND under Node.js ESM. The exports map in package.json targets a path that does not exist in the published dist/.
Affected version
@digital-alchemy/core 26.6.21
Runtime: node v24.17.0
Symptom
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'.../@digital-alchemy/core/dist/testing/helpers/index.mjs'
imported from <consumer>.mjs
Any test or consumer importing TestRunner (or createMockLogger) via the @digital-alchemy/core/testing subpath fails to load under Node's exports resolver.
Root cause
package.json exports field contains a stale extra helpers/ path segment:
"./testing": "./dist/testing/helpers/index.mjs"
The mapped target ./dist/testing/helpers/index.mjs does not exist — there is no dist/testing/helpers/ directory in the published package.
The real barrel does exist at ./dist/testing/index.mjs (re-exports mock-logger and test-module), with types alongside at ./dist/testing/index.d.mts.
Proposed fix (one line in package.json)
Before:
"./testing": "./dist/testing/helpers/index.mjs"
After:
"./testing": "./dist/testing/index.mjs"
The export target is a bare string, so this single correction resolves both the runtime .mjs and the TypeScript moduleResolution: node16/bundler types via the adjacent ./dist/testing/index.d.mts — no conditional import/types object needed.
Verification
After patching exports, a bare Node ESM import should resolve cleanly:
node --input-type=module -e \
'import("@digital-alchemy/core/testing").then(m => console.log(Object.keys(m)))'
# expected: [ 'createMockLogger', 'TestRunner' ]
Summary
import { TestRunner } from "@digital-alchemy/core/testing"throwsERR_MODULE_NOT_FOUNDunder Node.js ESM. Theexportsmap inpackage.jsontargets a path that does not exist in the publisheddist/.Affected version
@digital-alchemy/core26.6.21Runtime: node v24.17.0
Symptom
Any test or consumer importing
TestRunner(orcreateMockLogger) via the@digital-alchemy/core/testingsubpath fails to load under Node's exports resolver.Root cause
package.jsonexportsfield contains a stale extrahelpers/path segment:The mapped target
./dist/testing/helpers/index.mjsdoes not exist — there is nodist/testing/helpers/directory in the published package.The real barrel does exist at
./dist/testing/index.mjs(re-exportsmock-loggerandtest-module), with types alongside at./dist/testing/index.d.mts.Proposed fix (one line in package.json)
Before:
After:
The export target is a bare string, so this single correction resolves both the runtime
.mjsand the TypeScriptmoduleResolution: node16/bundlertypes via the adjacent./dist/testing/index.d.mts— no conditionalimport/typesobject needed.Verification
After patching
exports, a bare Node ESM import should resolve cleanly: