Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

v1.6.4 - failing to build in production mode - multiple version of GraphQL

default discord avatar
Deleted User2 years ago
6

I am trying to build payload using the generated Dockerfile by the

create-payload-app

script. It tries to build application using the build script which generates a bundle folder that is including multiple versions of GraphQL as shown with this error:


Error: Cannot use GraphQLScalarType "DateTime" from another module or realm.

But fixing it by forcing the latest version of graphql with a resolution block in package.json breaks the admin interface as they are expected older versions.


"resolutions": {
    "graphql": "16.6.0",
    "**/graphql": "16.6.0"
  },


So what versions should satisfy both, server and admin interface?

  • discord user avatar
    denolfe
    2 years ago

    Hey

    @456226577798135808

    , I'm taking a look into this now. Let me try to recreate.



    I'm not able to recreate this. Which template did you choose? Did you perform any modifications?

  • discord user avatar
    dribbens
    2 years ago

    There is a related thread on github,

    https://github.com/payloadcms/payload/discussions/1856

    about this problem while using npm. What package manager are you using?


    We're going to look into this more today.



    I

    was

    able to recreate the graphql error from the steps in the thread on github ^


    That should give us more to look into.

  • discord user avatar
    denolfe
    2 years ago

    Interesting,

    @456226577798135808

    does your Dockerfile contain npm commands or yarn commands? (This is generated by create-payload-app based upon what you have installed on your machine)

  • default discord avatar
    hswmk2 years ago

    Hello, got almost this problem today, Error: Expected DateTime to be a GraphQL nullable type.



    Using PNPM, working in build in local, but crash in railway ,,,



    The worse thing is i don't even use GraphQL, it would be really great to dissociate GraphQL and import it as a subpackage for people wanting to use it

  • discord user avatar
    denolfe
    2 years ago

    We definitely have had this conversation and have plans to abstract out certain pieces from the core of Payload if it makes sense.



    In the meantime, you could disable graphql by putting this in your config


    graph: {
      disable: true
    }
  • default discord avatar
    hswmk2 years ago

    My bad didn’t saw this configuration option, thank you ! But yeah it would be great to have it only if wanted 🙏

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.