-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Unresolved dependencies when "exports" field property's value is array #670
Comments
@guybedford do we support this kind of format in node? I couldn't find it in the docs. |
I tried it out and it seems to be supported in latest Node 14. I am also seeing this in the wild as used by As it appears to be supported, maybe this is just a documentation issue cc @guybedford ? |
Yes it is supported and in the spec (per the modules documentation on the Node.js project) but not explicitly documented as it is not a recommended feature for any use cases. This comes from the builtins fallback feature that import maps originally supported, and Node.js can provide support for that similarly if necessary in future by supporting. I believe webpack may be encouraging the array form via https://webpack.js.org/guides/package-exports/#alternatives but we don't encourage using it in Node.js. |
That means we should support it nonetheless?
Where is that? |
Yes I agree it should be supported. The exact resolver specification can be found at https://nodejs.org/dist/latest-v15.x/docs/api/esm.html#esm_resolver_algorithm_specification, and the array resolution is detailed in PACKAGE_TARGET_RESOLVE under the array condition. |
Will pick this up. |
@rollup/plugin-node-resolve
11.0.0
2.34.0
MacOS Catalina
v14.5.0
Expected Behavior
Successful bundle for packages whose
"exports"
field inpackage.json
is array like below:Actual Behavior
Unable to bundle, output like this:
Additional Information
Please see the reproduce repository link. Also this bug was found from prettier/prettier#9804.
If this is my misunderstand, sorry please close this.
The text was updated successfully, but these errors were encountered: