-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tenant Invalid Relationship when installing multi-tenant example #10874
Comments
Please add a reproduction in order for us to be able to investigate. Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided. Why was this issue marked with the
|
@jotapee the issue is that the example is already outdated, and it seems like there's no check nor a guarantee if the example works. To fix your local setup, head to the const defaultTenantArrayField = tenantsArrayField({
tenantsCollectionSlug: "tenants", // this is missing in the example
arrayFieldAccess: {},
tenantFieldAccess: {},
rowFields: [
{
name: "roles",
type: "select",
defaultValue: ["tenant-viewer"],
hasMany: true,
options: ["tenant-admin", "tenant-viewer"],
required: true,
},
],
}); |
@janbiasi thank you very much. I was looking for a configuration problem considering that was the official example. I never imagined it could be broken from the get go. Thanks for your help. |
This issue has been automatically locked. |
Describe the Bug
Hi,
I'm having issues trying to use the multi-tentant example.
After following indications I get:
`node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/payload/src/fields/config/sanitize.ts:114
throw new InvalidFieldRelationship(field, relationship)
^
InvalidFieldRelationship: Field Tenant has invalid relationship 'undefined'.`
Link to the code that reproduces this issue
Reproduction Steps
Run:
npx create-payload-app --example multi-tenant
Then:
npm run dev
oryarn dev
Which area(s) are affected? (Select all that apply)
area: core, area: templates
Environment Info
The text was updated successfully, but these errors were encountered: