pokedex-react icon indicating copy to clipboard operation
pokedex-react copied to clipboard

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

Open peturk opened this issue 9 years ago • 4 comments

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"

peturk avatar Jan 10 '17 16:01 peturk

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?

marktani avatar Jan 10 '17 17:01 marktani

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 👍

peturk avatar Jan 10 '17 17:01 peturk

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:

marktani avatar Jan 10 '17 17:01 marktani

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 👍

peturk avatar Jan 10 '17 21:01 peturk