Skip to content

Field with type "array" stop process #18

Closed

Description

@ipatate

apparently it's not possible to use array type for field. It's normal ? thanks 👍🏼

Activity

  1. schickling commented on Nov 2, 2021

    @schickling
    Collaborator

    Can you please provide more information? What's the error message you're seeing? Ideally please provide a repro using Gitpod.

  2. ipatate commented on Nov 2, 2021

    @ipatate
    Author

    yes, sorry.

    The config :

      name: "Post",
      filePathPattern: `post/*.mdx`,
      fields: {
        title: {
          type: "string",
          description: "The title of the post",
          required: true,
        },
        date: {
          type: "date",
          description: "The date of the post",
          required: true,
        },
        cat: {
          type: "array",
          description: "The categories of the post",
          required: true,
        },
      },
    }));
    

    The error in the console :

    ./node_modules/.bin/contentlayer build
    InterruptedException: Interrupted by fibers: #1
    

    Never use gitpod, i try after.

  3. schickling commented on Nov 2, 2021

    @schickling
    Collaborator

    Thanks for providing this additional information. type: "array" isn't a valid field type. We should improve the error handling in this case.

    The following should be closer to what you want:

      name: "Post",
      filePathPattern: `post/*.mdx`,
      fields: {
        title: {
          type: "string",
          description: "The title of the post",
          required: true,
        },
        date: {
          type: "date",
          description: "The date of the post",
          required: true,
        },
        cat: {
          type: "list",
          of: { type: "string" },
          description: "The categories of the post",
          required: true,
        },
      },
    }));
  4. ipatate commented on Nov 2, 2021

    @ipatate
    Author

    Ok, thanks for the time to respond me 💯

  5. added
    question
    and removed on Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions