decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.8k stars 3.03k forks source link

TypeError: Cannot read properties of undefined (reading 'get') #5867

Closed stevengmorrell closed 1 year ago

stevengmorrell commented 2 years ago

Describe the bug

When navigating to an existing article or when trying to create a new article the preview pane shows the error described in the title.

To Reproduce

Navigate to article edit/create.

Expected behavior

Preview of content show in preview pane.

Screenshots Screenshot 2021-10-04 195158

Applicable Versions:

CMS configuration


backend:
  name: git-gateway
  branch: master
  commit_messages:
    create: Create {{collection}} “{{slug}}”
    update: Update {{collection}} “{{slug}}”
    delete: Delete {{collection}} “{{slug}}”
    uploadMedia: "[skip ci] Upload “{{path}}”"
    deleteMedia: "[skip ci] Delete “{{path}}”"
media_folder: src/img
public_folder: /img
logo_url: https://stupefied-swirles-203f65.netlify.app/img/cvlNoBackground.png
collections:
  - name: blog
    label: Blog
    folder: src/pages/blog
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
      - label: Template Key
        name: templateKey
        widget: hidden
        default: blog-post
      - label: Title
        name: title
        widget: string
      - label: Publish Date
        name: date
        widget: datetime
      - label: Description
        name: description
        widget: text
      - label: Featured Post
        name: featuredpost
        widget: boolean
        required: false
      - label: Featured Image
        name: featuredimage
        widget: image
      - label: Body
        name: body
        widget: markdown
        required: false
      - label: Tags
        name: tags
        widget: list
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - date
      - commit_author
      - description
    view_filters: []
    view_groups: []
  - name: deal
    label: Deals
    folder: src/pages/deals
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
      - label: Template Key
        name: templateKey
        widget: hidden
        default: deal
      - label: Publish Date
        name: date
        widget: datetime
      - label: Name
        name: title
        widget: string
      - label: Model
        name: model
        widget: string
      - label: Paints/Upgrades
        name: upgrades
        widget: string
        required: false
      - label: Image
        name: image
        widget: image
      - label: In Stock
        name: inStock
        widget: boolean
        required: false
      - label: Personal Monthly Payment
        name: personalPayment
        widget: number
      - label: Business Monthly Payment
        name: businessPayment
        widget: number
      - label: Months Up Front
        name: upfrontMonths
        widget: number
      - label: Remaining Contract Months
        name: contractMonths
        widget: number
      - label: Miles Per Annum
        name: annualMiles
        widget: number
      - label: Description
        name: description
        widget: markdown
        required: false
      - label: Dealer Notes
        name: notes
        widget: markdown
        required: false
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - date
      - commit_author
      - description
    view_filters: []
    view_groups: []
  - name: pages
    label: Pages
    files:
      - file: src/pages/index.md
        label: Landing Page
        name: index
        fields:
          - label: Template Key
            name: templateKey
            widget: hidden
            default: index-page
          - label: Title
            name: title
            widget: string
          - label: Image
            name: image
            widget: image
          - label: Heading
            name: heading
            widget: string
          - label: Subheading
            name: subheading
            widget: string
          - label: Mainpitch
            name: mainpitch
            widget: object
            fields:

...
erezrokah commented 2 years ago

Hi @stevengmorrell, can you share a public repo reproducing the error? This doesn't happen with our test site, so we'll need more information about you setup to reproduce.

This error is usually the result of an issue with a custom preview template which is user code.