Using default payload user system
Unable to register the first user when deployed to cloud - receive the following error on call
/api/users/first-register
[17:33:50] ERROR (payload): TypeError: Cannot read properties of undefined (reading 'config')
at /home/node/node_modules/payload/src/fields/validations.ts:322:55
at Array.filter (<anonymous>)
at relationship (/home/node/node_modules/payload/src/fields/validations.ts:304:41)
at Object.field.validate (/home/node/node_modules/payload/src/fields/config/sanitize.ts:56:46)
at promise (/home/node/node_modules/payload/src/fields/hooks/beforeChange/promise.ts:125:44)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at traverseFields (/home/node/node_modules/payload/src/fields/hooks/beforeChange/traverseFields.ts:60:3)
at beforeChange (/home/node/node_modules/payload/src/fields/hooks/beforeChange/index.ts:34:3)
at create (/home/node/node_modules/payload/src/collections/operations/create.ts:174:29)
Are you able to access the admin panel? I've always just registered the first user through there
I get redirected to the first user screen
/admin/create-first-user
where it fails to register the user - also happens on my local
On my local - I registered the first user on 1.6.16 which worked - will try to downgrade
The latest version is 1.16.22, you could try using that? Why would you downgrade? Also maybe a stupid question but do you have your Payload config defined? And do you have the config path environment variable set up?
hmm what has a config property
just weird it happens on a collection config
Mmm, yeah, we might need to see your config
Ok, I have found the issue. The plugin for last modified by from
https://payloadcms.com/docs/plugins/overviewwas also adding it to the users - probably causing the validation to fail. So I created the first user way ahead and didn't go though that flow after while adding features/plugins. Thanks for helping !
So downgrading and upgrading didn't work but disabling my plugins made the error location obvious.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.