Hi. I am receiving this error during development of my Payload instance. It appears inside of the Admin ui's browser console. Webpack does not catch the error, during building.
The full error is here (I am using pnpm with symlinks so trace is a bit weird):
Caused by
payload/dist/config/defaults.js
caught TypeError: path_1.default.resolve is not a function
at ../../node_modules/.pnpm/payload@1.7.1_monaco-editor@0.37.1_scheduler@0.23.0_typescript@5.0.4/node_modules/payload/dist/config/defaults.js (defaults.js:20:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at fn (hot module replacement:62:1)
at ../../node_modules/.pnpm/payload@1.7.1_monaco-editor@0.37.1_scheduler@0.23.0_typescript@5.0.4/node_modules/payload/dist/config/sanitize.js (sanitize.js:13:20)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at fn (hot module replacement:62:1)
at ../../node_modules/.pnpm/payload@1.7.1_monaco-editor@0.37.1_scheduler@0.23.0_typescript@5.0.4/node_modules/payload/dist/config/build.js (build.js:7:36)
at __webpack_require__ (bootstrap:24:1)
.
No matter what I am doing in payload.config.ts, it fails. Everything that uses Node API's is commented out, server restarted, yet it still fails.
Environment info:
System:
OS: macOS 13.2
CPU: (8) x64 Apple M1
Memory: 5.23 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.9.0 - ~/Library/pnpm/node
Yarn: 1.22.11 - /usr/local/bin/yarn
npm: 9.6.3 - ~/Library/pnpm/npm
Watchman: 2023.02.20.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 112.0.5615.121
Firefox Developer Edition: 108.0
Safari: 16.3
npmPackages:
@payloadcms/plugin-cloud-storage: ^1.0.15 => 1.0.15
payload: ^1.7.1 => 1.7.1
Just did a full prune of the PNPM store, clean install of payload and the issue has resolved itself. Weird though as 1.7.1 is still the version I'm using.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.