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 cannot resolve exports entry #727

Closed
FredKSchott opened this issue Dec 11, 2020 · 5 comments
Closed

node-resolve cannot resolve exports entry #727

FredKSchott opened this issue Dec 11, 2020 · 5 comments

Comments

@FredKSchott
Copy link
Contributor

FredKSchott commented Dec 11, 2020

  • Rollup Plugin Name: node-resolve
  • Rollup Plugin Version: 11.0.0
  • Rollup Version: latest
  • Operating System (or Browser): Mac
  • Node Version: v12.18.3
  • Link to reproduction: see below

Reproduction

// script.mjs
import {rollup} from 'rollup';
import cjsPlugin from '@rollup/plugin-commonjs';
import resolvePlugin from '@rollup/plugin-node-resolve';
rollup({
    input: {
        'bundle.js': 'input.js',
    },
    plugins: [
        resolvePlugin(),
        cjsPlugin(), 
    ],
});

// input.js
import _extends from '@babel/runtime/helpers/esm/extends';

// @babel/runtime/package.json ("exports" field contains entry for "./helpers/esm/extends")
https://unpkg.com/browse/@babel/runtime@7.12.5/package.json

Expected Behavior

@babel/runtime/helpers/esm/extends resolves correctly, based on package "exports" map.

Actual Behavior

(node:60458) UnhandledPromiseRejectionWarning: Error: Could not load /Users/fks/Code/snowpack/node_modules/@babel/runtime/helpers/esm/extends (imported by input.js): ENOENT: no such file or directory, open '/Users/fks/Code/snowpack/node_modules/@babel/runtime/helpers/esm/extends'

Additional Information

I can reproduce in both CJS & ESM mode for Node. I know that #684 exists but I think this is a different issue, since in this case the export map is actually correct, and both the import and export map entry are extensionless.

@TrySound
Copy link
Member

This is fixed here #675 but not released yet

@shellscape
Copy link
Collaborator

(@FredKSchott note that's not a valid reproduction, and we hold everyone to providing one that matches an option from the template)

@FredKSchott
Copy link
Contributor Author

Thank you! Looking forward to that fix getting released. Feel free to close this if it's already being tracked elsewhere.

@shellscape apologies! it was late at night and I was rushing to wrap up and head to bed :)

@dimfeld
Copy link

dimfeld commented Dec 18, 2020

Confirmed upgrading the node-resolve plugin to 11.0.1 works. Thanks!

@shellscape
Copy link
Collaborator

Whoops, meant to comment. Closing citing the latest version working.

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

No branches or pull requests

4 participants