typescript/graphql example: TypeError: Cannot read property 'length' of undefined
See original GitHub issueWhen 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:
- Created 5 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 😍
There were quite some issues with
nexus
andnexus-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 👍