'ambiguous resolution module' when bundler compiling linked projects with both package.json contains same dependency #22471
Labels
Bug
Resolution: Locked
This issue was locked by the bot.
Tech: Bundler 📦
This issue is related to the bundler (Metro, Haul, etc) used.
Environment (
react-native info
)Environment:
Packages: (wanted => installed)
Description
In a library project which is created using react-native-create-library, by default node_modules directory is not loaded up with packages including react and react-native. It's working just fine if we only do native coding. The problem is when we need to import and use a package to put some javascript code.
Unable to resolve module
signify that an application project never share it's module packages to the linked library project. Unfortunately, neither we can add a package to library project. When a project is linked to other project via symlink (on Windows the link is resided in C:\Users...\AppData\Local\Yarn\Data\link), all package.json file from each linked projects are not allowed to contains the same dependency among each other. If we compile in such condition, this error come outIt's totally out of mind if we have to export native module via a limitable version of .js and we cannot even unlimit it. So I think it's seriously a bug which need to be debugged. Thank you
Reproducible Demo
Component
. From library project directory,yarn add react --save
to add the package and import it from a.js
react-native run-android
from an application project directory and you'll meet the errorReferences
The text was updated successfully, but these errors were encountered: