Skip to content

Not working anymore in v3.  #3

@danielkoller

Description

@danielkoller

Hi,

thanks for the example and the video.

Unfortunately with v3 released, this example is outdated.

[Function: CustomSelectComponent]
 ⨯ node_modules/.pnpm/payload@3.2.2_graphql@16.9.0_monaco-editor@0.52.0_react-dom@19.0.0-rc-66855b96-20241106_react_2wvkd4npc2dg5f3kjasvewy6ly/node_modules/payload/dist/bin/generateImportMap/index.js (81:1) @ addToImportMap
 ⨯ Error: addToImportMap > Payload component must be an object or a string
    at async IndexPage (./src/app/[locale]/(frontend)/page.tsx:57:21)
digest: "2847518325"
  79 |         if (typeof payloadComponent !== 'object' && typeof payloadComponent !== 'string') {
  80 |             console.error(payloadComponent);
> 81 |             throw new Error('addToImportMap > Payload component must be an object or a string');
     | ^
  82 |         }
  83 |         if (Array.isArray(payloadComponent)) {
  84 |             for (const component of payloadComponent){

I also get this TypeScript-Error for the Component.

types.d.ts(127, 9): The expected type comes from property 'Field' which is declared here on type '{ Cell?: CustomComponent; Description?: CustomComponent<FieldDescriptionClientComponent | FieldDescriptionServerComponent>; Field?: CustomComponent<...>; Filter?: PayloadComponent; } | ... 20 more ... | ({ ...; } & { ...; })'

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions