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
Module react
does not exist in the Haste module map. for library with only JS(react) code
#65
Comments
@Samykills how do you link the library? You should reference the library within the |
I'm getting the same error. @Samykills, did you manage to solve it? |
Maybe it has to be moved to the dependency list. I had a similar error in the project
and the fix was to explicitly add |
@maicki ^^^ that's the error I was talking about earlier. |
@thorbenprimke Did you add |
To my app. But this issue was the third in Google results when searching
for *does not exist in the Haste module map*.
So I suppose this error has to do with a dependency missing. Something
definitely changed in the tooling because it worked fine in the past.
…On Wed, Aug 29, 2018, 8:38 AM Michael Schneider ***@***.***> wrote:
@thorbenprimke <https://github.com/thorbenprimke> Did you add dateformat
to the dependency list of the library or the app you use the lib?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtRh_Ndmjb1cI2Lb3RFUyYlsUd53-Ktks5uVrWCgaJpZM4Ulpxi>
.
|
got it resolved by using "react-native start --reset-cache", the reference changed from Desktop to node_modules. |
fixed by npm add @babel/runtime |
Add this command to your terminal >_ Problem solved! |
What happened with me for this problem, I encountered this problem twice,
-- then i ran npm cache clean, ( the result asked to run command 'npm install --cache /tmp/empty-cache' |
Delete your node_module and run npm install |
Similar error said my lib does not exist in the Haste module map. None of above resolve the issue. |
as of today, I still have to npm i the package remotely; npm link only works for the native code - once the build completes the javascript doesn't work - I get this error |
@evanjmg Do you mean |
I ran into this same issue. I inspected the node_modules folder for the custom library, and it looks like the custom library was not copied there properly. Instead, it stores a reference to wherever the library is stored on your computer. For me, it was at a different directory. I think that the npm start server was not able to properly handle copying the referenced folder from the node_modules. For a workaround, I deleted the reference, created a new directory in node_modules with the same name, then copied all files from where the library exists, to that newly created directory in node_modules. Then it worked. |
I'm confused by React-Native's official documentation, specifically:
It seems to imply that running Are our options really just:
Both of these feel like an unecessary extra step, especially considering what the React-Native docs seem to imply is possible. |
what worked for me was to check at the top of your file so that it does not imported something like
Remove that and it works |
Thank you, I think you are correct about the React-Native's doc, |
If nothing work try to update
|
Yep it looks like symlinks are the issue. Having the same problem with importing sibling modules within a Yarn Workspaces mono-repo. I think the solution for now will be to use watchman to manually copy over the sibling module to the consumer's node_modules folder on every change. |
i created a library using react-native-create-library named myLib and i have a RN app from react-native-cli named myApp.
The library "myLib" does not contain any native code and only JS code which imports react(basically made a component that i want to be shared), here is the package.json
{
"name": "myLib",
"version": "1.0.0",
"description": "Set of components to be used throught the app",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [
"react-native",
"basic-components"
],
"author": {
"name": "Ullas",
},
"license": "",
"deprecated": false,
"dependencies": {
"apisauce": "0.15.2",
"react-native-navbar": "2.1.0"
},
"peerDependencies": {
"react": "16.3.1",
"react-native": "0.55.4"
}
}
when i link this to the RN app "myApp" i get the error :
error: bundling failed: Error: Unable to resolve module
react
from/Users/ullas/Desktop/myLib/index.js
: Modulereact
does not exist in the Haste module map.even though i have react as part of my node_modules for myApp project.
How can i run this and use the dependencies provided by the peer project for my library rather then define dependencies of its own and duplicating the same?
need help :(
The text was updated successfully, but these errors were encountered: