Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rosanche opened this issue May 19, 2020 · 6 comments
Closed

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

rosanche opened this issue May 19, 2020 · 6 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: GraphQL Related to Gatsby's GraphQL layer type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@rosanche
Copy link

rosanche commented May 19, 2020

Hi everyone !

I can't launch my website anymore after installing graphql, and graphql-yoga.
I am using the command gatsby develop

Below is the error i get :

⠋ building schema

 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
    [RealVest]/[graphql-compose]/lib/SchemaComposer.js:365:11
  
  - SchemaComposer.js:563 SchemaComposer.addAsComposer
    [RealVest]/[graphql-compose]/lib/SchemaComposer.js:563:27
  
  - schema-composer.js:35 createSchemaComposer
    [RealVest]/[gatsby]/dist/schema/schema-composer.js:35:18
  
  - index.js:135 Object.build
    [RealVest]/[gatsby]/dist/schema/index.js:135:26
  
  - index.js:392 async module.exports
    [RealVest]/[gatsby]/dist/bootstrap/index.js:392:3
  
  - develop.js:439 async module.exports
    [RealVest]/[gatsby]/dist/commands/develop.js:439:7
  
not finished building schema - 0.186s

I update my graphql dependencies at the same level :

npm list graphql           
gatsby-starter-default@0.1.0 /Users/Romain/Desktop/Programming/RealVest
├─┬ gatsby@2.21.39
│ ├─┬ gatsby-cli@2.12.24
│ │ └─┬ gatsby-recipes@0.1.21
│ │   └── graphql@14.6.0 
│ └── graphql@14.6.0 
├── graphql@14.6.0 
└─┬ graphql-yoga@1.18.3
  ├─┬ @types/graphql@14.5.0
  │ └── graphql@14.6.0  deduped
  └── UNMET PEER DEPENDENCY graphql@14.6.0 

Gatsby :

  System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.2.0 - /usr/local/bin/node
    npm: 6.14.5 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 81.0.4044.138
    Safari: 13.1
  npmPackages:
    gatsby: ^2.21.7 => 2.21.39
    gatsby-image: ^2.4.0 => 2.4.4
    gatsby-plugin-manifest: ^2.4.1 => 2.4.5
    gatsby-plugin-offline: ^3.2.0 => 3.2.3
    gatsby-plugin-react-helmet: ^3.3.0 => 3.3.1
    gatsby-plugin-sass: ^2.3.0 => 2.3.1
    gatsby-plugin-sharp: ^2.6.0 => 2.6.5
    gatsby-plugin-typescript: ^2.4.0 => 2.4.2
    gatsby-source-filesystem: ^2.3.0 => 2.3.4
    gatsby-transformer-sharp: ^2.5.0 => 2.5.2
  npmGlobalPackages:
    gatsby-cli: 2.11.17
    gatsby: 2.20.31

I already tried to delete my node_modules and package-lock.json then to run npm install again but it didn't work...

Does anyone have an idea what it could be?

@rosanche rosanche added the type: question or discussion Issue discussing or asking a question about Gatsby label May 19, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 19, 2020
@pvdz pvdz added topic: GraphQL Related to Gatsby's GraphQL layer and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 19, 2020
@pvdz
Copy link
Contributor

pvdz commented May 19, 2020

@rosanche more information would be nice. What is the build output? Where are you getting the error? How are you "launching" your website? What commands are you running? Do you have a repo we can check out?

Also, next time, can you please use triple ticks to paste a block of code? It will format better (I've edited your description accordingly)

cc @vladar @freiksenet for more information.

@pvdz pvdz added the status: needs more info Needs triaging and reproducible examples or more information to be resolved label May 19, 2020
@rosanche
Copy link
Author

@pvdz Thanks ! I just updated my post with the informations needed !
Have anyone have an idea how I could solve it ?
I already tried to delete my node_modules and package-lock.json then to run npm install again but it didn't work...

@vladar
Copy link
Contributor

vladar commented May 20, 2020

Hi @rosanche !

It is most likely a dependency (npm) issue. You still have multiple graphql instances somehow (not deduped by npm).

Usually deleting package-lock.json and updating packages fix this kind of errors. It's weird that it didn't work for you. Can you try installing deps with yarn (just to confirm it is a dependency issue)?

Also, can you share a minimal reproduction? Maybe package.json with some default starter will be enough.

@vladar vladar added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: needs more info Needs triaging and reproducible examples or more information to be resolved labels May 20, 2020
@LekoArts
Copy link
Contributor

This is a duplicate of #23062 (comment)

@rosanche
Copy link
Author

Thanks @vladar ! I deleted my package-lock and use npm update instead of npm installand it works !

@roberjacobo
Copy link

It didnt work for me :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. topic: GraphQL Related to Gatsby's GraphQL layer type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

5 participants