Crash on initialization

default discord avatar
redblueflame
last month

Hi,


I'm currently in the process of upgrading all my projects to payload 2, but I wanted to try with a testing environment for my plugins.



In order to check, I wanted to start fresh, so I used

npx create-payload-app -n dev -t blank --use-pnpm

and the mongodb adapter.


The setup was successful, but I'm encountering the following error when running

pnpm dev

:


$PROJECT_DIR\node_modules\.pnpm\@payloadcms+richtext-slate@1.0.0_react-dom@18.2.0\node_modules\@payloadcms\richtext-slate\src\index.ts:14
    CellComponent: withMergedProps({
                                  ^
TypeError: (0 , _utilities.withMergedProps) is not a function
    at slateEditor ($PROJECT_DIR\node_modules\.pnpm\@payloadcms+richtext-slate@1.0.0_react-dom@18.2.0\node_modules\@payloadcms\richtext-slate\src\index.ts:14:35)
    at Object.<anonymous> ($PROJECT_DIR\dev\src\payload.config.ts:16:22)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module.m._compile ($PROJECT_DIR\node_modules\.pnpm\ts-node@9.1.1_typescript@4.9.5\node_modules\ts-node\src\index.ts:1056:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .ts] ($PROJECT_DIR\node_modules\.pnpm\ts-node@9.1.1_typescript@4.9.5\node_modules\ts-node\src\index.ts:1059:12)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)

Is there a known issue ?



Update: Manually updating dependencies in the package.json to the following:


{
    "@payloadcms/bundler-webpack": "^1.0.4",// From ^1.0.0
    "@payloadcms/db-mongodb": "^1.0.4", // From ^1.0.0
    "@payloadcms/richtext-slate": "^1.0.6", // From ^1.0.0
    "cross-env": "^7.0.3",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "payload": "^2.0.11" // From ^2.0.0
}

Allowed me to go one error further:


Module not found: Error: Can't resolve '$PROJECT_DIR\node_modules\.pnpm\@payloadcms+bundler-webpack@1.0.0_@swc+core@1.3.80\node_modules\payload\dist\admin' in '$PROJECT_DIR\dev'


Update #2, saving the file correctly and re-running pnpm install did work.

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

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

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