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

[node-resolve] Can not resolve exports with extension #1548

Closed
susnux opened this issue Aug 2, 2023 · 0 comments · Fixed by #1549
Closed

[node-resolve] Can not resolve exports with extension #1548

susnux opened this issue Aug 2, 2023 · 0 comments · Fixed by #1549

Comments

@susnux
Copy link
Contributor

susnux commented Aug 2, 2023

Expected Behavior

Rollup can resolve exports with extensions like:

import { foo } from 'dummy-exported/foo.js'

with exports like this:

{
  "name": "dummy-exported",
  "version": "1.0.0",
  "exports": {
    "./*.js": {
      "import": "./dist/*.mjs",
      "require": "./dist/*.cjs"
    }
  }
}

Actual Behavior

(!) Plugin node-resolve: Could not resolve import "dummy-exported/foo.js" in /tmp/a/src/main.js using exports defined in /tmp/a/node_modules/dummy-exported/package.json.
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
dummy-exported/foo.js (imported by "src/main.js")

Additional Information

See linked repository to reproduce the issue. You can also see that the exports section is correct, because Node can resolve the module correctly (see by running inside the example):

node ./src/main.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant