Urigo / WhatsApp-Clone-Tutorial

https://www.tortilla.academy/Urigo/WhatsApp-Clone-Tutorial

Home Page:https://tortilla.academy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Can't resolve ../../graphql/types"

ryanlozon opened this issue · comments

First off, thanks so much for creating this tutorial. It is truly amazing.

I was following along but then decided to clone from step 16 to have a look at the finished project. After the clone, I ran the "yarn prestart" and "yarn prebuild" but I'm getting this error still.
Module not found: Can't resolve '../../graphql/types' in '/Users/ryanlozon/code/WhatsApp-Clone-Tutorial/client/WhatsApp-Clone-Client-React/src/components/ChatCreationScreen'

It looks like the when I navigate to the graphql folder on the client there is indeed no types folder, however there is a "types.tsx."

I'm rather new to typescript and codegen so I apologize if it is a straight forward question, I just couldn't find any other answers online.

Thank you for your time.

It looks like probably a mis-version between the server and the client.
Can you try to use the latest master on the server and the latest master on the client?

@Urigo I made sure I cloned the latest version for client and server. Then ran yarn build on both. Server-side worked fine but client-side gave me this error.

yarn run v1.10.1
$ yarn codegen
$ gql-gen
  ✔ Parse configuration
  ❯ Generate outputs
    ❯ Generate ./src/graphql/types.tsx
      ✖ Load GraphQL schemas
        → Unable to find matching files for glob: ../Whatsapp-Clone-Server/modules/*/*.ts in directory: /Users/ryanlozon/code/WhatsApp-Clone-Tutorial/client
        Load GraphQL documents
        Generate


 Found 1 error

  ✖ ./src/graphql/types.tsx
    Error: Unable to find matching files for glob: ../Whatsapp-Clone-Server/modules/*/*.ts in directory: /Users/ryanlozon/code/WhatsApp-Clone-Tutorial/client``` 

mmm try to make sure they are cloned under the same folder and that the server folder is exactly
called Whatsapp-Clone-Server

I've added instructions on the READ of all the related repositories.

https://github.com/Urigo/WhatsApp-Clone-Tutorial#cloning-the-finished-app

I believe it should work for you now.

Please let me know if not.

Sorry for the issue

Please modify the file codegen.yml

schema: ../Whatsapp-Clone-Server/modules//.ts

to

schema: ../WhatsApp-Clone-Server/modules//.ts

@veerjainATgmail good catch!

Fixed and pushed to master, will be deployed to the website on the next release

Thank you!

released and deployed