question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v8 error: Cannot read property 'type' of undefined

See original GitHub issue

Getting the following error after upgrading to v8.0.2. Not sure if I should have migrated something somehow?

$ $(yarn bin)/gql-gen -u http://localhost:3000/graphql -t typescript -o src/app/data/schema.ts "src/**/*.{queries,fragments}.ts"
Loading GraphQL Introspection from remote: http://localhost:3000/graphql...
TypeError: Cannot read property 'type' of undefined
    at /home/simon/dev/plotist/plotist-ng/node_modules/graphql-codegen-core/dist/operations/build-selection-set.js:37:64
    at Array.map (native)
    at Object.buildSelectionSet (/home/simon/dev/plotist/plotist-ng/node_modules/graphql-codegen-core/dist/operations/build-selection-set.js:31:61)
    at Object.transformFragment (/home/simon/dev/plotist/plotist-ng/node_modules/graphql-codegen-core/dist/operations/transform-fragment-document.js:17:45)
    at /home/simon/dev/plotist/plotist-ng/node_modules/graphql-codegen-core/dist/operations/transform-document.js:21:65
    at Array.forEach (native)
    at transformDocument (/home/simon/dev/plotist/plotist-ng/node_modules/graphql-codegen-core/dist/operations/transform-document.js:16:17)
    at Object.<anonymous> (/home/simon/dev/plotist/plotist-ng/node_modules/graphql-code-generator/dist/cli.js:138:43)
    at step (/home/simon/dev/plotist/plotist-ng/node_modules/graphql-code-generator/dist/cli.js:32:23)
    at Object.next (/home/simon/dev/plotist/plotist-ng/node_modules/graphql-code-generator/dist/cli.js:13:53)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
dotansimhacommented, Jul 18, 2017

@altschuler yeah that is my goal for the next days - just want to make sure that we don’t have any other surprises like these issues 😃

Thank you so much for your review and help in fixing these issues!

0reactions
altschulercommented, Jul 18, 2017

Awesome, it works! The default emit templates (at least for typescript) are quite different than in 0.7, eg. ElementsQuery.Result is now emitted as Elements.Query so you might want to bump a major version?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
A guide on how to prevent the error "cannot Read Property '0' of Undefined", covering techniques such as try, catch, using const over...
Read more >
Uncaught TypeError : Cannot read properties of undefined
Causes for TypeError: Cannot Read Property of Undefined. The error clearly says that it is Undefined, which means the variable might be declared...
Read more >
TypeError: Cannot read properties of undefined (reading 'map')
The properties, products , that you're passing to your component ( Products ) are undefined. The Map method is taking in account the ......
Read more >
Uncaught TypeError: Cannot read property '1' of undefined
This error is because there is a property field in that model, on that form that doesn't have his generic value defined, probably...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found