-
Notifications
You must be signed in to change notification settings - Fork 637
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
unstable_enablePackageExports does not resolve the root '.' exports alias #965
unstable_enablePackageExports does not resolve the root '.' exports alias #965
Comments
Thanks for the bug report! Will investigate next week 👀
|
@huntie is const config = {
resolver: {
resolverMainFields: ['react-native', 'main'],
unstable_enablePackageExports: true,
unstable_conditionNames: ['react-native', 'require', 'import'],
},
}; This breaks bundling for me and |
Updating https://github.com/shamilovtim/metro76exportsrepro with the latest repro demonstrating my above comment. After all of the babel warnings you should receive the following error:
|
These are independent options. If However if that fails, then we fall back to Okay, I've reproduced the bug! It's related to how we locate a ➡️ Fix incoming. However, after fixing this, it's worth noting that other deps in your project seem to widely depend on Node.js APIs, which could independently be problematic.
|
Awesome, glad you found it!
Appreciate you pointing that out. I am aware of it and it's a huge pain in the butt. I'm asking the upstream guys to separate out the node implementation so I can get one that doesn't include stuff like classic-level. Readable Stream should be polyfilled but the polyfill seems to depend on node's readable-stream, which is strange. I hope to get this sorted out in the next couple of days. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
metro is 0.76.0
Given that
unstable_enablePackageExports
istrue
.Given the above exports in a package.json . It seems that metro does not recognize that
.
is the main package. I receive the following error:If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.https://github.com/shamilovtim/metro76exportsrepro
bug is present in package
@tbd54566975/dwn-sdk-js
What is the expected behavior?
Expect metro to resolve
"." : { }
inside of exports and recognize that this provide themain
resolution, which would lead it to finding index.js in the correct spot.Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Metro config
metro 0.76.0
yarn 1.22.18
node v16.18.0
npm 9.4.2
macOS latest
The text was updated successfully, but these errors were encountered: