-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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
Hot reloading error. (Unknown module "react-native") #6731
Comments
Having the same issue. Is there a way to disable hot reloading ? |
@adrienbrault If you are on iOS device do I'm not sure but for android I think it's |
@adrienbrault Hot reloading should be an opt-in option. I too am having this problem with Hot Reloading, although on Android. However someone else I know on another project is having no problems at all, I fear it's something in the project itself that is causing the problems |
+1 |
Same issue |
@magrinj I don't have access to |
@sylvainbaronnet You can dismiss the error view with the button at the bottom left, after that try again with |
Thanks !! It works again |
cc @martinbigio |
Same error here. After many many try and errors I found that you should always use Could reproduce this with a clean I found a local project that still works and created two npm-shrinkwrap files which shows that the problem doesn't happen with react 0.14.7 and happen with 0.14.8 (both times react-native 0.22.2). You find both npm-shrinkwrap files and the |
Hmm, mind trying with @cpojer, @skevy has anything changed on node-haste that could explain this? This is where react-transform is configures to import React/react-native: react-native/babel-preset/configs/hmr.js Line 28 in 3a1634e
|
I haven't touched anything in node-haste for a while, might wanna ask @davidaurelio :) |
Started debugging a bit the repro case of #6640 and confirmed react is on the Haste map of the resolver when the packager starts. Maybe the issue is that the dependency is added on transform time by the HMR plugin? That doesn't explain though why this stopped working. |
Taking a step back I realized this problem is different to the one on #6640. This one happens on runtime whereas the other one on resolution time. The problem we're having now is that the require ( I need to test this also works internally. If everything is fine I'll update the preset tomorrow with this fix. Sorry for the issue, please remember you can always disable hot reloading. Happy coding! cc @satya164 :) |
@martinbigio I followed you steps, it doesn't work :( |
@tianwalker2012 that's really weird, it does work for me. The file you need to modify is located on |
@martinbigio I'm having the same issue. I tried both versions:
The red box displays both times: Requiring unknown module "react-native". If you are sure the module is there, try restarting the packager or running "npm install". |
I just released a new version of the preset which fixes the issue locally on a brand new project for me. Could you update the preset to 1.5.6? Or create a new project to verify it works? |
@martinbigio Yes that fixed it for me. Thanks. |
Would be awesome if a couple more of people confirm this is working for them so that I can commit the code to the repo :) |
The problem lies definitely in my app code.
I will try to find out how exactly I can reproduce this. |
@martinbigio: Works for me after updating babel-preset-react-native with
Thanks! |
@pohy as per your screenshot you're not using 1.5.6 because |
@gaearon this is only a temporary hack to fix the issue and unblock people. The underlying problem is not only affecting HMR but also assets, check #6638. We'll ask @davidaurelio to take a look next week when he comes back. |
Interesting, |
make sure to reset the cache |
@pohy: You could try to stop the gradle daemon ( |
@martinbigio Yes, resetting cache helped, thanks for the help and sorry for the hassle! |
Summary:Fixes facebook#6731 Closes facebook#6748 Differential Revision: D3126410 Pulled By: martinbigio fb-gh-sync-id: fc462ec82e72914d13341a4543212c017bd3838c fbshipit-source-id: fc462ec82e72914d13341a4543212c017bd3838c
Hot reloading is not working. #6722 was closed as a dup of #6640. #6640 was Unknown module "React", the error I am getting is "Unknown module "react-native"." I tried to debug, but this is day 1 for me with react, node etc.
If it truly is fixed, please explain how to used the fixed version. I am working with a first time fresh install of everything this morning to try react.
I saw this comment:
As far as I can tell I am up to date using 1.5.5.
Thanks.
The text was updated successfully, but these errors were encountered: