Skip to content

[v6] 🔥Unable to install as per quick start guide #2126

Closed

Description

@matthieunelmes

Issue

Describe your issue here

As per docs tried running:
npx @react-native-community/cli@next init --template=@react-native-firebase/template@alpha <myProjectName>

Install does not complete, error:
error Error: Cannot find module '/var/folders/s7/v2pwtdc96fzbv2s8j10mf3340000gn/T/rncli-init-template-k19y8J/node_modules/@react-native-firebase/template@alpha/template.config'



Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

Activity

  1. Salakar commented on May 9, 2019

    @Salakar
    Contributor

    cc @thymikee - think this is a bug on the CLI with templates, the path to the template.config file being loaded has the NPM tag @alpha tag in the path (and also the @ from the NPM org) - should be stripped out I'm guessing. Must be a recent bug - was working a couple of days ago.

    - error Error: Cannot find module '<truncated>/@react-native-firebase/template@alpha/template.config'
    + error Error: Cannot find module '<truncated>/react-native-firebase/template/template.config'

    Thanks for the report @matthieunelmes 👍

  2. NdauwaRafael commented on May 10, 2019

    @NdauwaRafael

    I have the same issue

  3. thymikee commented on May 10, 2019

    @thymikee

    @Salakar we didn't have a release in ~20 days. This is a bug indeed, fixed in react-native-community/cli#364. We'll have a release shortly, right after react-native-community/cli#372 is merged (I'm waiting for someone to review it once again, help appreciated 😃)

  4. thymikee commented on May 10, 2019

    @thymikee

    Published @react-native-community/cli@2.0.0-alpha.18 with the fix

  5. matthieunelmes commented on May 10, 2019

    @matthieunelmes
    Author

    Thanks for jumping on this, look forward to trying it out

  6. matthieunelmes commented on May 13, 2019

    @matthieunelmes
    Author

    Sorry guys, no dice.

    Can successfully install via the template, trying to follow docs and have installed .plist into the Xcode project but it's failing to build. Have tried auto-linking, manual linking, installing via pods, building via workspace but nothing is working. Keep getting:

    'Firebase/Firebase.h' file not found

    Not really the quick start I had in mind 😕and the docs feel very sporadic. I would love to contribute to the docs if only I knew the correct process to get a working build.

  7. mikehardy commented on May 13, 2019

    @mikehardy
    Collaborator

    @matthieunelmes please post your own issue, we have no idea what your setup is, and your error seems to be unrelated

  8. matthieunelmes commented on May 13, 2019

    @matthieunelmes
    Author

    @mikehardy This is my own issue and this by following the Quick start guide:

    Integrating with existing project:
    https://invertase.io/oss/react-native-firebase/quick-start/existing-project

    Adding Firebase to iOS: (Title on page is incorrect as it says Android)
    https://invertase.io/oss/react-native-firebase/quick-start/ios-firebase-credentials

    On that first link there are even TODO's left in the text!
    // TODO(salakar) React Native version requirements
    // TODO(salakar): Manual or Automatic linking for Android & ios

    I'm sorry that you seem to have taken an exception to the way I've worded my issues, but clearly the docs are incomplete. I've followed both guides in the links above (non-pods setup) and the Xcode error I'm getting is 'Firebase/Firebase.h' file not found

  9. mikehardy commented on May 13, 2019

    @mikehardy
    Collaborator

    Apologies! I did not see this was your own issue. We get a lot of people posting months-old followups on issues and I was scanning very quickly, let me look more closely

  10. matthieunelmes commented on May 13, 2019

    @matthieunelmes
    Author

    That's ok, as I say. I'm happy to help contribute to documentation once we find out what is going wrong

  11. mikehardy commented on May 13, 2019

    @mikehardy
    Collaborator

    I see this is for the new-new stuff (CLI next etc) - I can say I tried to use all the v6 stuff and new-CLI and all that yesterday in order to make a repro case for the firebase ios sdk (which has moved to a version that react-native-firebase 5.3.x doesn't support as it is locked to 5.20.2 firebase-ios if I understand correctly), and I met with failure as well. I think it's just not baked enough yet personally (though it is labeled correctly with alphas and nexts and WIPs etc)

    I got farther than the error message you indicated, but gradle wouldn't build android, with some sort of iterator error I did not dig into

    I will re-try in a couple revisions but I didn't personally have time to fuzzbust, I use react-native-firebase 5.3.x exclusively for actual work

    Sorry I can't help more

    I would suggest indicating clearly in the title of this issue that it is a react-native-firebase 6.x issue, as 5.3.x and 6.x are very different beasts. I check the 5.3.x start periodically (as recently as a week ago even) and I know it works at least

  12. matthieunelmes commented on May 13, 2019

    @matthieunelmes
    Author

    Could you kindly link me to any V5 documentation?

    EDIT
    I've found it:
    https://rnfirebase.io/docs/v5.x.x/getting-started

  13. 42 remaining items

  14. matthieunelmes commented on May 21, 2019

    @matthieunelmes
    Author

    @Salakar Yeah I can't get the other import method to work. Although to be honest, I don't really know what I'm doing in Xcode and spend the vast majority of my time copy/pasta from tutorials.

  15. Salakar commented on May 21, 2019

    @Salakar
    Contributor

    @mikehardy oh wow - I know what this is but equally, it's not happening for me locally =/ let me dig into it a bit today, again 🙈

  16. Salakar commented on May 21, 2019

    @Salakar
    Contributor

    @matthieunelmes Yeah I can't get the other import method to work.

    Thanks; I'll update the docs

  17. Ehesp commented on May 21, 2019

    @Ehesp
    Member

    @mikehardy this should be fixed now. Out of interest are you on windows? This was an issue with the firebase.json file.

  18. mikehardy commented on May 21, 2019

    @mikehardy
    Collaborator

    @Ehesp @Salakar works on android now! 💪 - v6 is obviously a long path, but this is huge for me (an end user) - now I can easily play to test things (like auth, which I haven't looked at yet)

    @thymikee there was one interesting thing (for me). You will need a google-services.json from firebase to do this (they are free at least) but the CLI works one way and fails the other for me on linux (Ubuntu 19.04 right now but shouldn't vary vs 18)

    If you do:
    npx @react-native-community/cli@next init --template=@react-native-firebase/template@alpha firebaseanalyzertests

    it works, that part is excellent. Then I copy my Firebase credentials in:
    cd firebaseanalyzertests/ && cp ../firebaseanalyzertests-google-services.json android/app/google-services.json

    ...again, no problems. But now if I go like this:
    npx @react-native-community/cli@next start - it does this error when the app starts fetching the bundle:

    mike@isabela:~/work/react-random/firebaseanalyzertests % npx @react-native-community/cli@next start
    ┌──────────────────────────────────────────────────────────────────────────────┐
    │                                                                              │
    │  Running Metro Bundler on port 8081.                                         │
    │                                                                              │
    │  Keep Metro running while developing on any JS projects. Feel free to        │
    │  close this tab and run your own Metro instance if you prefer.               │
    │                                                                              │
    │  https://github.com/facebook/react-native                                    │
    │                                                                              │
    └──────────────────────────────────────────────────────────────────────────────┘
    
    Looking for JS files in
       /home/mike/work/react-random/firebaseanalyzertests 
    
    Loading dependency graph, done.
    error: bundling failed: Error: Unable to resolve module `./../../../.npm/_npx/23897/lib/node_modules/@react-native-community/cli/node_modules/react-transform-hmr/lib/index.js` from `/home/mike/work/react-random/firebaseanalyzertests/App.js`: The module `./../../../.npm/_npx/23897/lib/node_modules/@react-native-community/cli/node_modules/react-transform-hmr/lib/index.js` could not be found from `/home/mike/work/react-random/firebaseanalyzertests/App.js`. Indeed, none of these files exist:
      * `/home/mike/.npm/_npx/23897/lib/node_modules/@react-native-community/cli/node_modules/react-transform-hmr/lib/index.js(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
      * `/home/mike/.npm/_npx/23897/lib/node_modules/@react-native-community/cli/node_modules/react-transform-hmr/lib/index.js/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
        at ModuleResolver.resolveDependency (/home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
        at ResolutionRequest.resolveDependency (/home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
        at DependencyGraph.resolveDependency (/home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/node-haste/DependencyGraph.js:283:16)
        at Object.resolve (/home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/lib/transformHelpers.js:262:42)
        at /home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:399:31
        at Array.map (<anonymous>)
        at resolveDependencies (/home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:18)
        at /home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:269:33
        at Generator.next (<anonymous>)
        at asyncGeneratorStep (/home/mike/.npm/_npx/27309/lib/node_modules/@react-native-community/cli/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
     DELTA  [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (3/179), failed.
    
    ::ffff:127.0.0.1 - - [21/May/2019:16:57:18 +0000] "GET /index.delta?platform=android&dev=true&minify=false&revisionId=944783f0ba7599b3 HTTP/1.1" 500 - "-" "okhttp/3.12.1"
    

    Maybe this is where my big reset button in react-native-clean-project would be useful? Though I tried to --reset-cache, and I tried to delete the /tmp/haste* stuff etc

    When I do this:
    ./node_modules/.bin/react-native run-android

    ...everything is perfect

    ? 🤔

  19. thymikee commented on May 21, 2019

    @thymikee

    @mikehardy looks like npx sets up some symlinks that Metro is not able to resolve (we observe the same behavior running start command locally.) For the time being, can you add @react-native-community/cli@next as your dev dependency and run from there? That should work just fine:

    yarn add --dev @react-native-community/cli@next 
    yarn react-native start
    
  20. mikehardy commented on May 21, 2019

    @mikehardy
    Collaborator

    @thymikee in the template here for react-native-firebase v6 it is already set, so there is no real issue here (and apart from windows, I think they'll be able to close this issue in a bit). I just wanted to make sure you were aware of the problem (sounds like you are) since all the repro commands and logs are available. Sounds like you guys are on it

  21. bondparkerbond commented on May 22, 2019

    @bondparkerbond

    @mikehardy looks like npx sets up some symlinks that Metro is not able to resolve (we observe the same behavior running start command locally.) For the time being, can you add @react-native-community/cli@next as your dev dependency and run from there? That should work just fine:

    yarn add --dev @react-native-community/cli@next 
    yarn react-native start
    

    @thymikee Is the latest RN cli setting up the correct symlinks? Can we use v6 without npx?
    I'm going to try adding v6 to my app this week so any info is appreciated, thanks in advance!

  22. mikehardy commented on May 22, 2019

    @mikehardy
    Collaborator

    @bondparkerbond - in fact, npx does not work (for me on android at least) but the CLI inside module works, specifically either ./node_modules/.bin/react-native run-android or yarn react-native start will start it up for me correctly

  23. Salakar commented on May 23, 2019

    @Salakar
    Contributor

    Using npx to create the the app from the template etc is fine, it's only using npx to run react native start that's the issue, you can just run that as normal instead without npx.

  24. stale commented on Jun 20, 2019

    @stale

    Hello 👋, to help manage issues we automatically close stale issues.
    This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

    This issue will be closed in 15 days if no further activity occurs.
    Thank you for your contributions.

  25. added
    Type: StaleIssue has become stale - automatically added by Stale bot
    on Jun 20, 2019
  26. stale commented on Jul 5, 2019

    @stale

    Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

  27. BenLorantfy commented on Jul 7, 2019

    @BenLorantfy

    For anyone else still having this issue: I was running into this when trying to install the template without the @alpha tag, but I made a PR to the cli that fixes it: react-native-community/cli#497

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: StaleIssue has become stale - automatically added by Stale botblocked: react-nativeIssue or PR blocked by a React Native issue or change.type: bugNew bug report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions