TypeError: Cannot convert undefined or null to object
See original GitHub issueWith the new 1.0.0 (and Node.js v12.18.3) I’m having an error:
It looks like you may have hit a bug in graphql-schema-linter.
It would be super helpful if you could report this here: https://github.com/cjoudrey/graphql-schema-linter/issues/new
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at ignoreListErrorFilter (/Users/me/Project/node_modules/graphql-schema-linter/lib/validator.js:143:39)
at validateSchemaDefinition (/Users/me/Project/node_modules/graphql-schema-linter/lib/validator.js:72:68)
at run (/Users/me/Project/node_modules/graphql-schema-linter/lib/runner.js:68:58)
This is how I’m running it:
#!/usr/bin/env bash
set -e
# Enable `**` globstar
shopt -s globstar
# Also append AWS AppSync definitions
# See https://github.com/cjoudrey/graphql-schema-linter/issues/165
graphql-schema-linter \
--comment-descriptions \
schema/**/*.graphql graphql-schema-linter-aws.graphql
Note that this is working fine with 0.5.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Cannot convert undefined or null to object - Stack Overflow
Generic answer. This error is caused when you call a function that expects an Object as its argument, but pass undefined or null...
Read more >Cannot convert undefined or null to Object in JavaScript
The "Cannot convert undefined or null to Object" error occurs when we pass a null or an undefined value to a function that...
Read more >Object.keys(null) possible - cannot convert undefined or ...
Conditions above this line allow msg===null to get into Object.keys(msg);. livedata_connection.js:1626 Uncaught TypeError: Cannot convert ...
Read more >Cannot convert undefined or null to object - YouTube
JavaScript : How to resolve TypeError : Cannot convert undefined or null to object [ Gift : Animated Search Engine ...
Read more >Cannot convert undefined or null to object : r/learnjavascript
Your code throws the error because before fetch completes, location is undefined, but you are telling react to iterate over it, which can't...
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
It’s fixed for me if I add
"ignore": {}
to my linter config, so if I had to guess I think it’s this line that’s doing it: https://github.com/cjoudrey/graphql-schema-linter/commit/5dc06315cfdb4cf2b42df2b628df80bbf6c1b93c#diff-91ba5f4df12e1b6b0629662164b3f14eR32Just need to add a default value of
{}
for ignoreShould probably run the tests using a config file that doesn’t have the ignore field as well 😃
Thanks all for your patience. This should now be fixed in
v1.0.1
.Also thanks to @paramjitkaur for opening a pull request with a fix. I appreciate the help! 😄