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.

Upgrading from 5.6.2 to 5.7.0 causes promise bug

See original GitHub issue

When upgrading from 5.6.2 to 5.7.0, with no other changes in the codebase I get the error below when making a query through graphql playground.

The field and query can be replaced with any other, the error is the same.

{
  "errors": [
    {
      "message": "Unknown object type \"promise\"",
      "locations": [
        {
          "line": 9,
          "column": 3
        }
      ],
      "path": [
        "account",
        "name"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Unknown object type \"promise\"",
            "    at Object._object (PATH/node_modules/object-hash/index.js:218:17)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object._function (PATH/node_modules/object-hash/index.js:319:14)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at hash (PATH/node_modules/object-hash/index.js:128:10)",
            "    at Object.objectHash [as hashFunction] (PATH/node_modules/object-hash/index.js:33:10)",
            "    at Rule.generateCacheKey (PATH/node_modules/graphql-shield/src/rules.ts:156:33)",
            "    at Rule.<anonymous> (PATH/node_modules/graphql-shield/src/rules.ts:53:29)",
            "    at Generator.next (<anonymous>)",
            "    at PATH/node_modules/graphql-shield/dist/rules.js:7:71",
            "    at new Promise (<anonymous>)",
            "    at __awaiter (PATH/node_modules/graphql-shield/dist/rules.js:3:12)",
            "    at Rule.resolve (PATH/node_modules/graphql-shield/dist/rules.js:31:16)"
          ]
        }
      }
    },
    {
      "message": "Unknown object type \"promise\"",
      "locations": [
        {
          "line": 11,
          "column": 3
        }
      ],
      "path": [
        "account",
        "createdAt"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Unknown object type \"promise\"",
            "    at Object._object (PATH/node_modules/object-hash/index.js:218:17)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object._function (PATH/node_modules/object-hash/index.js:319:14)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at hash (PATH/node_modules/object-hash/index.js:128:10)",
            "    at Object.objectHash [as hashFunction] (PATH/node_modules/object-hash/index.js:33:10)",
            "    at Rule.generateCacheKey (PATH/node_modules/graphql-shield/src/rules.ts:156:33)",
            "    at Rule.<anonymous> (PATH/node_modules/graphql-shield/src/rules.ts:53:29)",
            "    at Generator.next (<anonymous>)",
            "    at PATH/node_modules/graphql-shield/dist/rules.js:7:71",
            "    at new Promise (<anonymous>)",
            "    at __awaiter (PATH/node_modules/graphql-shield/dist/rules.js:3:12)",
            "    at Rule.resolve (PATH/node_modules/graphql-shield/dist/rules.js:31:16)"
          ]
        }
      }
    },
    {
      "message": "Unknown object type \"promise\"",
      "locations": [
        {
          "line": 13,
          "column": 3
        }
      ],
      "path": [
        "account",
        "organisation"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Unknown object type \"promise\"",
            "    at Object._object (PATH/node_modules/object-hash/index.js:218:17)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object._function (PATH/node_modules/object-hash/index.js:319:14)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at hash (PATH/node_modules/object-hash/index.js:128:10)",
            "    at Object.objectHash [as hashFunction] (PATH/node_modules/object-hash/index.js:33:10)",
            "    at Rule.generateCacheKey (PATH/node_modules/graphql-shield/src/rules.ts:156:33)",
            "    at Rule.<anonymous> (PATH/node_modules/graphql-shield/src/rules.ts:53:29)",
            "    at Generator.next (<anonymous>)",
            "    at PATH/node_modules/graphql-shield/dist/rules.js:7:71",
            "    at new Promise (<anonymous>)",
            "    at __awaiter (PATH/node_modules/graphql-shield/dist/rules.js:3:12)",
            "    at Rule.resolve (PATH/node_modules/graphql-shield/dist/rules.js:31:16)"
          ]
        }
      }
    },
    {
      "message": "Unknown object type \"promise\"",
      "locations": [
        {
          "line": 8,
          "column": 3
        }
      ],
      "path": [
        "account",
        "_id"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "Error: Unknown object type \"promise\"",
            "    at Object._object (PATH/node_modules/object-hash/index.js:218:17)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object._function (PATH/node_modules/object-hash/index.js:319:14)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at PATH/node_modules/object-hash/index.js:246:18",
            "    at Array.forEach (<anonymous>)",
            "    at Object._object (PATH/node_modules/object-hash/index.js:242:21)",
            "    at Object.dispatch (PATH/node_modules/object-hash/index.js:185:30)",
            "    at hash (PATH/node_modules/object-hash/index.js:128:10)",
            "    at Object.objectHash [as hashFunction] (PATH/node_modules/object-hash/index.js:33:10)",
            "    at Rule.generateCacheKey (PATH/node_modules/graphql-shield/src/rules.ts:156:33)",
            "    at Rule.<anonymous> (PATH/node_modules/graphql-shield/src/rules.ts:53:29)",
            "    at Generator.next (<anonymous>)",
            "    at PATH/node_modules/graphql-shield/dist/rules.js:7:71",
            "    at new Promise (<anonymous>)",
            "    at __awaiter (PATH/node_modules/graphql-shield/dist/rules.js:3:12)",
            "    at Rule.resolve (PATH/node_modules/graphql-shield/dist/rules.js:31:16)"
          ]
        }
      }
    }
  ],
  "data": {
    "account": null
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
shane-abcyacommented, Aug 1, 2019

I also have the same outcome/error messages for unknown object type. Just downgraded from “5.7.3” to “5.6.2” and it works as expected. While doing some digging I noticed that if I hard coded the “ignoreUnknown” option to true in the object-hash module 5.7.2 would work as well. The object type it wasn’t recognizing/liking for my project was a “promise” coming from a file upload scalar (graphql-upload)… I believe this bug is related to #408 as well.

0reactions
maticzavcommented, Aug 26, 2019

5.7.0 introduced a new default caching option. Due to strict evaluation which relied on hash, as mentioned, the bug appeared.

The latest version (6.0.6) fixed that by changing the default cache option to no_cache.

Thank you all for providing beneficial information. Please let me know if anyone still experiences the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changes per release
Changes in Release 5.7.0. A 3D graphics bug causing RowPro for Windows to crash for some people after upgrading to RowPro 5.6 is...
Read more >
resolver or addr is not configured for ENS name (argument ...
I run this code in browser, and can't catch promise rejection. ... As you say, this error is often caused by incorrect arguments,...
Read more >
2.11.3 Changes in MySQL 5.7
Upgrade the MySQL binaries in place by replacing the old binaries with the new ones. Start the MySQL 5.7 server normally (no special...
Read more >
Migrating from 4.x to 5.x
There are several backwards-breaking changes you should be aware of when migrating from Mongoose 4.x to Mongoose 5.x. If you're still on Mongoose...
Read more >
RELEASE-NOTES.md
Bug. * [KARAF-6654] - Remote JMX connection not working with security manager * [KARAF-6772] - Removing JAASLoginService entry in jetty.xml causes an error...
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