learnapollo / pokedex-react

A Pokedex App using and teaching Apollo and React
http://learnapollo.com
MIT License
47 stars 16 forks source link

PokemonCard.js?e9b4:37 Uncaught TypeError: Cannot read property 'fragments' of undefined #4

Open peturk opened 7 years ago

peturk commented 7 years ago

Exercise-04

I'm trying to apply these methods to my project, but I have not modified the files at all, just added the dependencies needed, exercise 1-3 worked fine.

I get a error in google devtools: PokemonCard.js?e9b4:37 Uncaught TypeError: Cannot read property 'fragments' of undefined line 37 it says: pokemon: propType(PokemonCard.fragments.pokemon).isRequired,

"save me"

marktani commented 7 years ago

Thanks for the report :stuck_out_tongue:

I think this is related to this topic: https://github.com/learnapollo/learnapollo/issues/29 What browser are you using?

peturk commented 7 years ago

Oh yes, I should have mentioned I tried: npm install --save-dev babel-plugin-transform-class-properties Which I found here: https://babeljs.io/docs/plugins/transform-class-properties/ but that did not fix the problem 😞

edit: I just noticed I did not put it in any config, looking into that now 👍

marktani commented 7 years ago

Cool, then this is related to using static properties instead of export const which I used that for the RN track

Would be great if you can create a PR :slightly_smiling_face:

peturk commented 7 years ago

I shared with you, files are in web/static/js/components Can't seem to make it work with the fragments so I commented them out in PokemonCard and PokemonCardHeader web/static/js/index.jsx is where I ApolloProvider is located 👍