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.

Error: Cannot create as TypeComposer the following value: Date.

See original GitHub issue

Description

While running ‘gatsby develop’ everything works till graphql schema is going to be built. Then it throws error.

ERROR 

UNHANDLED REJECTION Cannot create as TypeComposer the following value: Date.



 Error: Cannot create as TypeComposer the following value: Date.
 
 - SchemaComposer.js:365 SchemaComposer.createTempTC
   [store]/[graphql-compose]/lib/SchemaComposer.js:365:11
 
 - SchemaComposer.js:563 SchemaComposer.addAsComposer
   [store]/[graphql-compose]/lib/SchemaComposer.js:563:27
 
 - schema-composer.js:35 createSchemaComposer
   [store]/[gatsby]/dist/schema/schema-composer.js:35:18
 
 - index.js:135 Object.build
   [store]/[gatsby]/dist/schema/index.js:135:26
 
 - index.js:419 async module.exports
   [store]/[gatsby]/dist/bootstrap/index.js:419:3
 
 - develop.js:429 async module.exports
   [store]/[gatsby]/dist/commands/develop.js:429:7
 
not finished building schema - 0.172s

Steps to reproduce

Everything worked well until I installed Apollo dependencies and plugin

Expected result

Error shouldn’t appear and app should work

Actual result

Error when building graphql schema

Environment

  System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.12.0 - ~/.nvm/versions/node/v13.12.0/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v13.12.0/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v13.12.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 80.0.3987.163
    Firefox: 74.0.1
    Safari: 13.1
  npmPackages:
    gatsby: ^2.20.12 => 2.20.18
    gatsby-cli: ^2.11.7 => 2.11.7
    gatsby-image: ^2.3.1 => 2.3.2
    gatsby-plugin-apollo: ^3.0.1 => 3.0.1
    gatsby-plugin-manifest: ^2.3.3 => 2.3.3
    gatsby-plugin-offline: ^3.1.2 => 3.1.2
    gatsby-plugin-react-helmet: ^3.2.1 => 3.2.2
    gatsby-plugin-sharp: ^2.5.3 => 2.5.4
    gatsby-plugin-styled-components: ^3.2.1 => 3.2.1
    gatsby-source-filesystem: ^2.2.2 => 2.2.2
    gatsby-source-graphql: ^2.3.2 => 2.3.2
    gatsby-source-shopify: ^3.1.2 => 3.1.2
    gatsby-theme-apollo: ^3.0.2 => 3.0.2
    gatsby-transformer-sharp: ^2.4.3 => 2.4.4
  npmGlobalPackages:
    gatsby-cli: 2.11.7
    gatsby-starter-default: 0.1.0

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
jack0wskycommented, May 13, 2020

For those who will face this issue, I found out that you simply need to install older version of GraphQL. In my case, I had to install graphql@^14.6.0 instead of 15.0.0 version.

3reactions
pfftdammitchriscommented, Jul 19, 2020

I think the issue was having a different graphql version installed. I had graphql installed in dependencies, uninstalled it, was having the error still, then npm install gatsby and it worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot create as TypeComposer the following value ...
Can't launch Dev Server. I just get Error: Cannot create as TypeComposer the following value: Date. SchemaComposer.js:313 SchemaComposer.
Read more >
Issue with Gatsby's addThirdPartySchema - Stack Overflow
Error : Cannot create as TypeComposer the following value: Test. import * as graphql from "graphql"; import { SourceNodesArgs } ...
Read more >
TypeComposer - graphql-compose
Main class that gets GraphQLObjectType and provide ability to change them. Static methods. static create(). Create TypeComposer with adding it by name to ......
Read more >
Issues Updating to Gatsby 4.9.2 : r/gatsbyjs - Reddit
The error reads as ""gatsby-transformer-sharp" threw an error while ... was 'Error: Cannot create as TypeComposer the following value:" ...
Read more >
Can't get the blog example running on localhost
Missing onError handler for invocation 'building-schema', error was 'Error: Cannot create as TypeComposer the following value: ImageFormat.
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