You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running code that use the packaged & published library I get the following error:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './tasks' is not defined by "exports" in /Users/XXXX/project/test/node_modules/my-lib/package.json
at new NodeError (node:internal/errors:405:5)
at exportsNotFound (node:internal/modules/esm/resolve:362:10)
at packageExportsResolve (node:internal/modules/esm/resolve:698:9)
at resolveExports (node:internal/modules/cjs/loader:567:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:636:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue (/Users/XXXX/project/test/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
at Function.Module._resolveFilename (/Users/XXXX/project/test/node_modules/tsconfig-paths/lib/register.js:75:40)
at Function.Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
I assume its related to my setup, maybe the sourcemap pipeline, but this should be exported as a barrel regardless.
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
Declaring
barrel
additional export does not declare abarrel
reference in exports:Yields the following exports, in package.json:
The additional export was
libs/my-lib/tasks/index.ts
and the exported reference was"./tasks/index": "./tasks/index.js"
This will work with
import { something } from 'my-lib/tasks/index'
It will not work with
import { something } from 'my-lib/tasks'
Expected Behavior
When
index
is exported, also export a barrel reference.Around here:
nx/packages/js/src/utils/package-json/update-package-json.ts
Line 242 in 3523720
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
When running code that use the packaged & published library I get the following error:
I assume its related to my setup, maybe the sourcemap pipeline, but this should be exported as a barrel regardless.
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: