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.

typescript/graphql example: TypeError: Cannot read property 'length' of undefined

See original GitHub issue

When following the instructions in the README of the typescript/graphql example, I’m getting the following error after running npm run start:

$ npm run start

> typescript-graphql@ start /Users/nikolasburk/Desktop/prisma-examples/typescript/graphql
> ts-node-dev --no-notify --respawn --transpileOnly ./src

Using ts-node version 8.0.2, typescript version 3.3.1
TypeError: Cannot read property 'length' of undefined
    at Object.suggestionList (/Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/utils.js:43:32)
    at PrismaSchemaBuilder.SchemaBuilder.missingType (/Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:180:35)
    at PrismaSchemaBuilder.SchemaBuilder.getOrBuildType (/Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:432:21)
    at PrismaSchemaBuilder.SchemaBuilder.getInputType (/Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:397:25)
    at /Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:299:51
    at Array.forEach (<anonymous>)
    at PrismaSchemaBuilder.SchemaBuilder.buildArgs (/Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:296:27)
    at PrismaSchemaBuilder.SchemaBuilder.buildObjectField (/Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:285:24)
    at /Users/nikolasburk/Desktop/prisma-examples/typescript/graphql/node_modules/nexus-prisma/node_modules/nexus/dist/builder.js:258:57
    at Array.forEach (<anonymous>)
[ERROR] 10:53:17 TypeError: Cannot read property 'length' of undefined

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinmarreccommented, Feb 8, 2019

@nikolasburk Yeah, I updated to last versions/behaviors after reading the last Prisma Blog post, and everything rocks now 👌. I love the Code-First approach 😍

1reaction
nikolasburkcommented, Feb 8, 2019

There were quite some issues with nexus and nexus-prisma over the last few days, but now everything should be stable again. I just updated the graphql and graphql-auth examples to account for all the changes that were introduced 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Read Property Length of Undefined in JavaScript
The JavaScript TypeError: Cannot read property 'length' of undefined occurs when the length property is read on an undefined variable.
Read more >
TypeError with "Cannot read property 'length' of undefined"
It looks like to me that the ownerData.data.numberByOwnerByTo.items is returning undefined . the main issue seems to be that. you should fix ...
Read more >
Typeerror: Cannot Read Property 'length' of Undefined
Determine the number of characters inside of a string. The length property returns a number for essentially any object in JavaScript. Typeerrors ......
Read more >
Cannot read properties of undefined (reading 'length') - TrackJS
Cannot read property 'length' of undefined. TypeError is a subset of JavaScript Error that is thrown when code attempts to do something that ......
Read more >
TypeError: Cannot read property 'length' of undefined at model ...
For example: If you are using a file for import routes, have to import database.js and excecute it before excecute the controller.
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