CapRover Deploy Error: Error: Expected DateTime to be a GraphQL nullable type

default discord avatar
5 months ago
1 2

Hello, everybody!

I'm triyng to deploy a PayLoadCMS application using CapRover. CapRover is a platform that to server Docker containers.

Locally my application works very well. I have tested locally using de dev server (npm run dev) and building first (npm run build and npm run serve). Both ways worked locally. Locally I'm using Node.js v18.12.1.

In the CapRover, I'm trying to use the PayloadCMS default Dockerfile:

// -------------------------------------

FROM node:18.8-alpine as base

FROM base as builder

WORKDIR /home/node/app
COPY package*.json ./

COPY . .
RUN npm install
RUN npm run build

FROM base as runtime

ENV NODE_ENV=production
ENV PAYLOAD_CONFIG_PATH=dist/payload.config.js

WORKDIR /home/node/app
COPY package*.json ./

RUN npm install --production
COPY --from=builder /home/node/app/dist ./dist
COPY --from=builder /home/node/app/build ./build


CMD ["node", "dist/server.js"]

// ------------------------------------------

But I get this error log:

2023-04-18T18:32:32.421247766Z Node.js v18.8.0
2023-04-18T18:32:45.302659999Z [18:32:45] INFO (payload): Connected to Mongo server successfully!
2023-04-18T18:32:45.304796784Z [18:32:45] INFO (payload): Starting Payload...
2023-04-18T18:32:46.335923910Z /home/node/app/node_modules/payload/node_modules/graphql/jsutils/devAssert.js:12
2023-04-18T18:32:46.336010548Z throw new Error(message);
2023-04-18T18:32:46.336026035Z ^
2023-04-18T18:32:46.336040637Z Error: Expected DateTime to be a GraphQL nullable type.
2023-04-18T18:32:46.336079028Z at devAssert (/home/node/app/node_modules/payload/node_modules/graphql/jsutils/devAssert.js:12:11)
2023-04-18T18:32:46.336086863Z at new GraphQLNonNull (/home/node/app/node_modules/payload/node_modules/graphql/type/definition.js:395:32)
2023-04-18T18:32:46.336094151Z at /home/node/app/node_modules/payload/dist/collections/graphql/init.js:101:23
2023-04-18T18:32:46.336100908Z at Array.forEach ()
2023-04-18T18:32:46.336108778Z at initCollectionsGraphQL (/home/node/app/node_modules/payload/dist/collections/graphql/init.js:60:38)
2023-04-18T18:32:46.336115741Z at registerSchema (/home/node/app/node_modules/payload/dist/graphql/registerSchema.js:58:24)
2023-04-18T18:32:46.336122743Z at BasePayload.init (/home/node/app/node_modules/payload/dist/payload.js:210:42)
2023-04-18T18:32:46.336178828Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-04-18T18:32:46.336200303Z at async getPayload (/home/node/app/node_modules/payload/dist/payload.js:237:26)
2023-04-18T18:32:46.336208755Z at async initHTTP (/home/node/app/node_modules/payload/dist/initHTTP.js:28:21)

I have no clue why this is happening. Thanks for any help.

  • default discord avatar
    5 months ago

    I did the update from "payload": "^1.6.19" to payload": "^1.7.1 and worked very well!

    Thank you!

  • discord user avatar
    Payload Team
    5 months ago

    @HigorSilvaRosa What version of Payload are you seeing this on?

    1 reply
    default discord avatar
    5 months ago

    "payload": "^1.6.19"

Open the post
Continue the discussion in GitHub
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.