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:
… for barrel files (#27112)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->
## Current Behavior
<!-- This is the behavior we have today -->
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#23519
(cherry picked from commit 484e9b1)
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: