Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Issues with deployment on a VPS Server + Docker
Post Body

Hi everyone,

I'm having issues deploying a very simple Payload CMS project to my VPS Server using Docker.

My MongoDB database is up and running already, I was able to access it from my local computer and use it in my local PayloadCMS project.

Here is my payload.config.ts:

import { buildConfig } from 'payload/config';
import path from 'path';
import Users from './collections/Users';
// import { payloadCloud } from '@payloadcms/plugin-cloud';
import { slateEditor } from '@payloadcms/richtext-slate';

export default buildConfig({
  // editor: slateEditor({}),
  admin: {
    user: Users.slug,
  },
  collections: [
    Users,
    {
      slug: 'pages',
      fields: [
        {
          name: 'title',
          type: 'text',
          required: true,
        },
        {
          name: 'content',
          type: 'richText',
          required: true,
        },
        { name: 'language', type: 'select', options: ['English', 'French', 'Spanish'], required: true },
      ],
    },
  ],
  typescript: {
    outputFile: path.resolve(__dirname, 'payload-types.ts'),
  },
  graphQL: {
    schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
  },
  // plugins: [
  //   payloadCloud()
  // ]
});

I have this error on the container's log:

[nodemon] starting `ts-node src/server.ts`
[15:19:13] ERROR (payload): There were 1 errors validating your Payload config
[15:19:13] ERROR (payload): 1: "editor" is required
[nodemon] app crashed - waiting for file changes before starting...

Now when I uncomment the "editor" and its import I get this error (and it also crashes locally, but for with different error types):

[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts
[nodemon] starting `ts-node src/server.ts`

/home/node/app/node_modules/payload/src/payload.ts:352
    this.db = this.config.db({ payload: this })
                          ^
TypeError: this.config.db is not a function
    at BasePayload.init (/home/node/app/node_modules/payload/src/payload.ts:352:27)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at getPayload (/home/node/app/node_modules/payload/src/payload.ts:431:22)
    at initHTTP (/home/node/app/node_modules/payload/src/initHTTP.ts:33:19)
    at Payload.init (/home/node/app/node_modules/payload/src/index.ts:17:21)
[nodemon] app crashed - waiting for file changes before starting...

Hope someone can help!

Author
Account Strength
90%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,226
Link Karma
35
Comment Karma
1,191
Profile updated: 5 days ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago