keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Custom relationship field view not resolving in Admin UI build

Open Meetcpatel opened this issue 1 year ago • 0 comments

When trying to use a custom view for a relationship field in the Admin UI, the build process fails due to a module resolution error. The custom view file is not being correctly resolved during the Next.js build process that Keystone uses for the Admin UI. it works in development mode.

create a custom view, and use it in the schema
like example https://github.com/keystonejs/keystone/blob/main/examples/custom-field-view/schema.ts#L27

agent: relationship({
      ui: {
        labelField: "identityCode",
        displayMode: "select",
        views: "../components/FilteredRelationship.tsx",

it shold build without any error

Screenshot 2024-08-13 at 5 42 17 PM

here is package.json

"dependencies": {
    "@keystone-6/auth": "^7.0.0",
    "@keystone-6/core": "^5.0.0",
    "@keystone-6/document-renderer": "^1.1.2",
    "@keystone-6/fields-document": "^7.0.0",
    "react-infinite-scroll-component": "^6.1.0",
    "slate": "^0.103.0",
    "slate-history": "^0.100.0",
    "slate-react": "^0.107.1",
    "typescript": "^4.9.5",
    "uuid": "^10.0.0"
  }

Meetcpatel avatar Aug 13 '24 12:08 Meetcpatel