-
Notifications
You must be signed in to change notification settings - Fork 631
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
With symlinked packages: Error: Unable to resolve module @scope/ui
from /some/path.js
: Module @scope/ui
does not exist in the Haste module map
#286
Comments
We are dealing with a similar issue using yarn workspaces. Attempts to work around it using |
I believe that I'm getting the same problem. Before upgrade the React Native, it was working, but now I'm getting
|
Hi, versions: Here is my rn-cli.config.js
|
Symlinks are not currently supported by Metro. See this comment. |
@aleclarson at the moment I see that many people have found different workaround solutions to this issue and the other; among plethora of suggestions and comments I am kind of lost in what to do and what not. Can you please honestly suggest a best solution which works for all the issues?
|
@SachinB-Droisys The best solution is to fork Jest and Metro, and then use jestjs/jest#7549 and #257 in your local clones. But unfortunately, it's probably not the easiest solution. Instead, you could try what this comment suggests. Otherwise, you're on your own, sorry! |
Hi, What it does:
It worked for me ! |
@MehdiDonk wml package have many issue right now and not maintained |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I have a lerna monorepo where i decided to scope the packages inside. When I run
lerna link --force-local
(which essentially symlinks my local packages inside of others if they are mentioned in thepackage.json
) my React Native app at some point will have the following directory in it:./node_modules/@scope/ui
andui
is the symlinked directory.If I now start the metro bundler and run the app, it will throw following error:
I have seen all the other issues around this like facebook/react-native#4968 and #241 and many others, but this is something unrelated to the causes in the other issues.
How do I know it's a problem with symlinked packages? I simply threw a real copy of my package into my
./node_modules/@scope/ui
and it started working. It might be though that symlinked packages, if not put into a scope directory, work - I don't know because I didn't try that one.How to reproduce and a minimal repository on GitHub
https://github.com/mxmzb/MetroLinkedHasteExample and follow the README instructions
What is the expected behavior?
App finds and uses the package.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Note: it doesn't seem to matter if I use yarn or npm.
Metro configuration: As it comes with React Native
node: 8.12.0
yarn: 1.10.1
npm: 6.4.1
All on macOS
The text was updated successfully, but these errors were encountered: