Skip to content

Hot reloading error. (Unknown module "react-native") #6731

Closed

Description

@amberstar

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:

Should work now that we have released babel-preset-react-native@1.5.5. You'll have to upgrade from 1.5.4 to 1.5.5

As far as I can tell I am up to date using 1.5.5.

Thanks.

Activity

  1. adrienbrault commented on Mar 30, 2016

    @adrienbrault
    Contributor

    Having the same issue. Is there a way to disable hot reloading ?

  2. magrinj commented on Mar 30, 2016

    @magrinj
    Contributor

    @adrienbrault If you are on iOS device do ⌘ + D and click on Disable Hot Reloading

    I'm not sure but for android I think it's ⌘ + M, if you are not on a mac try Control instead of ⌘

  3. RealOrangeOne commented on Mar 30, 2016

    @RealOrangeOne

    @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

  4. hvsy commented on Mar 30, 2016

    @hvsy

    +1

  5. sylvainbaronnet commented on Mar 30, 2016

    @sylvainbaronnet

    Same issue

  6. sylvainbaronnet commented on Mar 30, 2016

    @sylvainbaronnet

    @magrinj I don't have access to ⌘ + D menu since the app crash, is there another way to disable hot reload ?

  7. magrinj commented on Mar 30, 2016

    @magrinj
    Contributor

    @sylvainbaronnet You can dismiss the error view with the button at the bottom left, after that try again with ⌘ + D, did you do that on an iOS simulator ?

  8. sylvainbaronnet commented on Mar 30, 2016

    @sylvainbaronnet

    Thanks !! It works again

  9. satya164 commented on Mar 30, 2016

    @satya164
    Contributor
  10. christoph-jerolimov commented on Mar 31, 2016

    @christoph-jerolimov
    Contributor

    Same error here. After many many try and errors I found that you should always use npm start -- --reset-cache when trying to "find" this issue.

    Could reproduce this with a clean react-native init project without any additional dependency.

    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 npm install output after adding the "old" version and re-run it here: https://gist.github.com/jerolimov/85051d319b69ea6fe8dd24fa0f79f5f4

  11. martinbigio commented on Mar 31, 2016

    @martinbigio
    Contributor

    Hmm, mind trying with babel-preset-react-native@1.5.4. Looks like for some people we have problems resolved React and for other react-native.

    @cpojer, @skevy has anything changed on node-haste that could explain this? This is where react-transform is configures to import React/react-native: https://github.com/facebook/react-native/blob/3a1634ec7b0dfa2b5d8890118565006d845e2039/babel-preset/configs/hmr.js#L28.

  12. cpojer commented on Mar 31, 2016

    @cpojer
    Contributor

    I haven't touched anything in node-haste for a while, might wanna ask @davidaurelio :)

  13. 8 remaining items

  14. gaearon commented on Mar 31, 2016

    @gaearon
    Collaborator

    react-native/Libraries/react-native/react-native.js

    😂

  15. pasqualino0815 commented on Mar 31, 2016

    @pasqualino0815

    The updated present is doing something different. I'm receiving now a tiny redbox in the upper left corner:
    tinyredbox
    ;)

  16. pasqualino0815 commented on Mar 31, 2016

    @pasqualino0815

    The problem lies definitely in my app code.
    Enabling hot reloading rendering only a simple view as follows works just fine.

         <View>
            <Text>
              Hello World
            </Text>
          </View>
    

    I will try to find out how exactly I can reproduce this.

  17. pohy commented on Mar 31, 2016

    @pohy

    The issue persists for me, am using babel-preset-react-native@1.5.6.
    player_2016-03-31_15-55-13

  18. maikokuppe commented on Mar 31, 2016

    @maikokuppe

    @martinbigio: Works for me after updating babel-preset-react-native with

    npm install babel-preset-react-native@1.5.6
    

    Thanks!

  19. martinbigio commented on Mar 31, 2016

    @martinbigio
    Contributor

    @pohy as per your screenshot you're not using 1.5.6 because react-native was changed for the full path.

  20. martinbigio commented on Mar 31, 2016

    @martinbigio
    Contributor

    @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.

  21. pohy commented on Mar 31, 2016

    @pohy

    Interesting, npm ls babel-preset-react-native shows, that I have 1.5.6, and even after fully rebuilding the app, it still does fail with Requiring unknown module "react-native"...

  22. martinbigio commented on Mar 31, 2016

    @martinbigio
    Contributor

    make sure to reset the cache npm start -- --reset-cache

  23. maikokuppe commented on Mar 31, 2016

    @maikokuppe

    @pohy: You could try to stop the gradle daemon (android/gradlew --stop works for me) and rebuild with react-native run-android.
    Just an idea

  24. pohy commented on Mar 31, 2016

    @pohy

    @martinbigio Yes, resetting cache helped, thanks for the help and sorry for the hassle!

  25. ghost closed this as completedin 4133de0on Apr 1, 2016
  26. locked as resolved and limited conversation to collaborators on May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions