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.

TypeError: Cannot convert undefined or null to object

See original GitHub issue

With 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
connorsheacommented, Sep 7, 2020

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-91ba5f4df12e1b6b0629662164b3f14eR32

Just need to add a default value of {} for ignore

Should probably run the tests using a config file that doesn’t have the ignore field as well 😃

1reaction
cjoudreycommented, Sep 11, 2020

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! 😄

Read more comments on GitHub >

github_iconTop 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 >

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