Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Handling of package.json#exports is not working correctly with intermediate wildcard. #4803

Closed
1 task
gpickell opened this issue Aug 30, 2022 · 6 comments · Fixed by #5331
Closed
1 task
Assignees
Labels
bug Something isn't working upholded Real issues without formal reproduction

Comments

@gpickell
Copy link

gpickell commented Aug 30, 2022

Self-service

  • I'd be willing to implement a fix

Describe the bug

When using yarn with pnp linking, the handling of the * in a package.json#exports has a compatibility issue. Mainly, if the * appears in the middle, it fails, but this is supported with node out-of-the-box.

package.json:

  ...

  "exports": {
    "./*/index": "./src/*.mjs", // not honored when linking pnp-style but works otherwise
    "./*": "./src/*.mjs" // works always
  }

  ...

To reproduce

See: https://github.com/gpickell/yarn-bug-exports-handling

yarn
yarn test # works
# remove nodeLinker line from .yarnrc.yml
yarn
yarn test # fails

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
  Binaries:
    Node: 16.16.0 - ~\AppData\Local\Temp\xfs-a40a0340\node.CMD
    Yarn: 3.2.3 - ~\AppData\Local\Temp\xfs-a40a0340\yarn.CMD
    npm: 8.11.0 - ~\AppData\Local\nvs\node\16.16.0\x64\npm.CMD

Additional context

No response

@gpickell gpickell added the bug Something isn't working label Aug 30, 2022
@arcanis
Copy link
Member

arcanis commented Sep 3, 2022

The exports support is provided by https://github.com/lukeed/resolve.exports, a bug should be open there

@arcanis arcanis added the external bug This issue highlights a bug in another project label Sep 3, 2022
@gpickell
Copy link
Author

I am issuing a pull request to resolve.exports --- more eyes would be appreciated.
See: lukeed/resolve.exports#21

@yarnbot

This comment was marked as outdated.

@yarnbot yarnbot added the stale Issues that didn't get attention label Oct 26, 2022
@merceyz merceyz added upholded Real issues without formal reproduction and removed external bug This issue highlights a bug in another project stale Issues that didn't get attention labels Oct 26, 2022
@merceyz merceyz self-assigned this Oct 26, 2022
@gpickell
Copy link
Author

gpickell commented Dec 4, 2022

I think the resolve.exports project might be a little on the "inactive side".

@merceyz
Copy link
Member

merceyz commented Dec 4, 2022

Indeed, I have a branch that fixes the issue but haven't had the time to complete it yet.

@gpickell
Copy link
Author

I believe resolve.exports project has been updated to fix this issue. The pull request is no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upholded Real issues without formal reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants