public-demo icon indicating copy to clipboard operation
public-demo copied to clipboard

Add “// database-adapter-config-end” to payload.config.ts

Open AlexJeffcott opened this issue 1 year ago • 0 comments

create-payload-app requires // database-adapter-config-end to work correctly.

https://github.com/payloadcms/public-demo/issues/34

As can be seen from the Terminal output, running the CLI and choosing ‘payload-demo’ and ‘PostgreSQL’ will reproduce the problem.

~/payload npx create-payload-app@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y) y

  Welcome to Payload. Let's create a project! 

✔ Project name? … cms
✔ Choose project template › payload-demo
✔ Select a database › PostgreSQL (beta)
✔ Enter PostgreSQL connection string … postgres://127.0.0.1:5432/cms

  Creating project in /Users/alex/payload/cms

⠋ Checking latest Payload version...? Unable to update payload.config.ts with database adapter import
✔ Dependencies installed
✔ .env file created
✔ Payload project successfully created

  ★ Launch Application:

    - cd ./cms
    - npm run dev or follow directions in README.md: file:///Users/alex/payload/cms/README.md

  ★ Documentation:

    - Getting Started: https://payloadcms.com/docs/getting-started/what-is-payload
    - Configuration: https://payloadcms.com/docs/configuration/overview


~/payload cd ./cms                     
~/payload/cms npm run dev

> [email protected] dev
> cross-env PAYLOAD_CONFIG_PATH=src/payload/payload.config.ts nodemon

[nodemon] 3.0.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts
[nodemon] starting `ts-node src/server.ts`
(node:31204) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
unhandledRejection ReferenceError: mongooseAdapter is not defined
    at Object.<anonymous> (/Users/alex/payload/cms/src/payload/payload.config.ts:88:7)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module.m._compile (/Users/alex/payload/cms/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/alex/payload/cms/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.call (node:internal/modules/cjs/loader:1235:19)
    at Module.mod.require (/Users/alex/payload/cms/node_modules/next/src/server/require-hook.ts:69:26)
    at require (node:internal/modules/helpers:176:18)
[nodemon] app crashed - waiting for file changes before starting...

AlexJeffcott avatar Nov 22 '23 08:11 AlexJeffcott