-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Unable to resolve module #11498
Comments
I'm glad you solved it - thanks for also posting the solution here to help other folks! |
Hey @lacker, I'm still experiencing this issue. Unfortunately, the solution I provided above is more of a workaround. Anytime I install a package with npm or yarn on any project, I have to go through the steps above |
@tedjames I have encountered the same problem |
@tedjames I have the same issue and thank you for posting a solution/workaround. But being the N00b I am I need some more instructions to how I run the commands you suggest. I try to use them in the CMD in my project folder, but get the response that commands are not recognized... Could someone elaborate the instruction please? Thank you in advance |
@ThunderBeard, rm -rf is not work in windows |
Thanks, so are there any instructions for windows then? |
Hey, @ThunderBeard and @ouzhou, what operating systems are you guys on? I have a feeling that this issue can be reproduced on Windows as well: #11772 |
Found another case similar this running on MacOS: #11257 |
This happens to me too now. Problem started with Axios for me as well. |
This happens to me too with Axios / RN 0.40. |
same thing here. on Windows - Axios / RN 0.40 |
Nothing seems to work for me, trying to install about 10 different XML parsers in R.N and just getting this error message. Anybody got any more solutions, almost tried everything :/ |
Solved but in a terrible wayTL:DR; use this in your package.json for now
For some reason packager traces down a require inside a conditional, but only on Windows machines! How? I have no clue. Perhaps @cpojer / @ide et al. can illuminate how this could be? This require should never be called, but somehow it is traversed by packager. Using my branch in npm (which comments out the offending require) fixes everything. This issue in other tickets
I wouldn't mind hearing the solution to this. I'm sure @skellock (who helped me track this down) wouldn't mind seeing the solution either. |
Problems just went away for me recently and for no apparent reason. Not too sure what I've done different besides the fact that I've tried RN 0.38 thru 0.40. |
Hi, I'm an Axios contributor. This conditional Has there been any change in the way RN resolves that? |
Yes. In 0.37 there was reorganization of these files (maybe when the bug arrived?). Recently this PR fixing Looks like we're good when 0.41 ships? I can confirm this weekend, but hopefully someone beats me to it. Thanks all! I learned a lot here. |
We still have problems resolving new libraries on 0.41, manually installing the dependency or resetting content and settings in the simulator sometimes helps, but it seems it is not yet fixed EDIT : all dependencies need to be declared / installed in react-native app directory, not in some parent directory, even if react-packager tells us he looks into others directories. |
i fixed the problem by following the workaround then install locally react-native, react and react-native-animatable which is the package cannot be resolved. Hope this help !
|
@tedjames why the |
Hi everyone, maybe it can help, I was having this issue because I was using a package that uses some nodejs utilities which are available on the global object. Hope it helps |
move your project to another path |
This is happening with me on a mac. Have reduced my project to a simple hello world that imports events from 'events' and error still occurs, the work around in the original post is not working even with a restart of the machine. note: this has nothing to do with axios, same bug though |
@whoadave The yarn add uuid was unnecessary in hindsight. Just noticed a warning in my console asking to use uuid instead of node-uuid. @PrimeLens Try wiping the cache of everything you listed, then uninstall and reinstall everything to their latest versions if possible. This includes xcode, rn-cli, rn, and node. Then start your project from scratch in a completely new directory. Be sure to set privileges to everyone on all directories and sub-directories within your project. |
@tedjames good lord that solution makes this feel like the dark ages!!! Ii'll try as you suggest, thanks for your response |
this has nothing to do with axios, same bug though |
Same bug :( |
Still, this does not work for me. Any help is much appreciated. Check out my repository here: https://github.com/hellomarcoliver/ReactNativeUIs/tree/master/Jobs |
I had a similar issue. Maybe mine seems stupid, but the guide I was using was telling me to create an artifacts folder for the compiled .js files. But after I stopped the output of compilation going elsewhere, like the artifacts folder, and instead, just left the output of compiled .js files next to the .tsx files this problem went away instantly. In other words, have your compiled .js files next to your .tsx files and this might fix your problem :) |
This is so frustrating & annoying, the only thing that works for me is to create a completely new project & move my files over. Are there any updates on this? |
Description
Unfortunately, I’ve run into a devastating bug that prevents me from loading any new modules into my app. I first discovered this bug when reaching the part of a react native course by Stephen Grider where he goes into networking with Axios.
After installing Axios with NPM, I imported it, saved index.ios.js, and refreshed the simulator. After refreshing I was greeted with the message shown below:
Whenever I removed the import statement for Axios and refreshed, the error would go away:
Reproduction
To reproduce this, I'd suggest building the app with NPM and/or Yarn running on Node 4.7 or the latest LTS release, Node 6.9.2
I can provide a repository later today if that would help...
Solution - just a workaround...
Try this:
If you don't have yarn installed, run these commands instead:
Additional Information
I was really excited to finally get started with React Native but this bug absolutely kills my ability to proceed with any tutorials/courses. I'd really appreciate if someone could help me out with this.
Thanks :)
The text was updated successfully, but these errors were encountered: