Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Issue with apollo-codegen #1672

Closed
jdisho opened this issue Mar 21, 2018 · 16 comments
Closed

Issue with apollo-codegen #1672

jdisho opened this issue Mar 21, 2018 · 16 comments
Labels
❔ question Question pending discussion or card yet to be correctly triaged

Comments

@jdisho
Copy link
Collaborator

jdisho commented Mar 21, 2018

I am trying to run GitHawk, but somehow apollo script is not working. API.swift have no content after the script runs.
I am lost on this because globally I have apollo-codegen@0.18.8, the same as the one in the app. 😕

@jdisho jdisho added the ❔ question Question pending discussion or card yet to be correctly triaged label Mar 21, 2018
@jdisho
Copy link
Collaborator Author

jdisho commented Mar 21, 2018

screen shot 2018-03-21 at 13 40 45

... and this is weird

@rnystrom
Copy link
Member

What happens if you run npm install from the project dir?

@jdisho
Copy link
Collaborator Author

jdisho commented Mar 22, 2018

@rnystrom Tried that before, not working. 😕
Probably there is a problem with apollo script?

Sent with GitHawk

@jdisho
Copy link
Collaborator Author

jdisho commented Mar 22, 2018

Any idea? 💡 @SD10 @BasThomas

@BasThomas
Copy link
Collaborator

BasThomas commented Mar 22, 2018

Have you followed the installation instructions from the Readme? What is the output for brew install node and npm install? You shouldn't have to run npm install in the beginning; only after you've cloned. I think we should update this documentation to make that more clear.

@jdisho
Copy link
Collaborator Author

jdisho commented Mar 22, 2018

@BasThomas Sure, I followed the installation instructions. This problem occurred as soon as I pulled the changes from master. Before updating to apollo-codegen@0.18.8 everything was working fine.

Btw, the outputs output for brew install node and npm install :

screen shot 2018-03-22 at 22 02 56

screen shot 2018-03-22 at 22 00 39

@jdisho
Copy link
Collaborator Author

jdisho commented Mar 22, 2018

@rnystrom Is it necessary to add the apollo script in the repo when the API.swift is there?

@SD10
Copy link
Member

SD10 commented Mar 22, 2018

Hey @jdisho, sorry I've had little time for GitHawk lately 😭 I did get the same error a few days ago I think when upgrading apollo. I just fixed it in a brutish way by clearing all derived data, restarting simulators, Xcode, and a fresh npm install.

@BasThomas
Copy link
Collaborator

A fresh install of what? 😛

@rnystrom
Copy link
Member

@jdisho hmm I’m really not sure tbh... if the file is empty and the script is writing there’s def a problem with the local install.

Sent with GitHawk

@BasThomas
Copy link
Collaborator

I ran the instructions in a separate clone of the repository and that just worked. 🤔
It does, however, only generate the Freetime-AppCenter scheme (not sure if related), what's up with that @rnystrom?

@SD10
Copy link
Member

SD10 commented Mar 23, 2018

Sorry, I meant a fresh npm install

Sent with GitHawk

@rnystrom
Copy link
Member

@BasThomas leftover scheme from trying AC, but I already migrated Bitrise to use it. Uses the shared scheme with dummy env vars.

Sent with GitHawk

@rizwankce
Copy link
Collaborator

rizwankce commented Mar 23, 2018

@jdisho May be your npm install doesn't work properly.

Can you confirm you can find this folder in your repo.

node_modules/apollo-codegen/

Btw, this is what I get when I run project from master branch now.

screen shot 2018-03-23 at 6 24 04 pm

EDIT:

After checking little bit more.

Apollo Build script in our project doesn't use any npm. Instead, it is calling a script called "check-and-run-apollo-codegen.sh". This script is failing for you and saying that it can not find npm

Recent changes from Apollo scripts allows us to use locally installed apollo-codegen - instead of global one.

So may give it a try reinstalling npm itself and make sure that it is in your local bin.

➜ where npm
/usr/local/bin/npm

@BasThomas
Copy link
Collaborator

@rnystrom yeah but it does not generate a normal “GitHawk” scheme :/

Sent with GitHawk

@orta
Copy link
Contributor

orta commented Mar 24, 2018

You probably want to run ‘npm uninstall -g Apollo-codegen’

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❔ question Question pending discussion or card yet to be correctly triaged
Projects
None yet
Development

No branches or pull requests

6 participants