Skip to content

TypeError: Cannot read properties of undefined (reading 'push') #6460

Closed as not planned
@jakesing

Description

@jakesing

Describe the bug
Clicking "now" to change date of post is not working. Same issue occurs if I try to update the date using a different method.

To Reproduce
Visit collection 'legal', document 'User Agreement' and click 'Now'. This crashes the site and shows me this error:

"TypeError: Cannot read properties of undefined (reading 'push') at i.value (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:172:53116) at i.value (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:172:52079) at Fa (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:69876) at Na (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:69671) at gs (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:105470) at ul (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:96717) at sl (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:96642) at Js (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:93672) at https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:188:45314 at t.unstable_runWithPriority (https://unpkg.com/netlify-cms@%5E2.0.0/dist/netlify-cms.js:196:3844)"

Expected behavior
Date changes to "Now"

Screenshots

Applicable Versions:

  • Netlify CMS version: netlify-cms@2.10.192
  • Git provider: git-gateway
  • Browser version: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36

CMS configuration

backend:
  name: git-gateway
  repo: jakesing/gatsby-swapstack
  branch: main
media_folder: static/img
public_folder: /img
publish_mode: editorial_workflow
collections:
  - name: blog
    label: Blog
    folder: content/blog
    create: true
    slug: index
    media_folder: ""
    public_folder: ""
    path: "{{title}}/index"
    editor:
      preview: false
    fields:
      - label: Title
        name: title
        widget: string
      - label: Author
        name: author
        widget: relation
        collection: authors
        value_field: email
        display_fields:
          - name
        search_fields:
          - name
          - email
      - label: Publish Date
        name: date
        widget: datetime
      - label: Description
        name: description
        widget: string
      - label: Body
        name: body
        widget: markdown
      - label: Featured Image
        name: thumbnail
        widget: image
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - date
      - commit_author
      - description
    view_filters: []
    view_groups: []
  - name: authors
    label: Authors
    folder: src/pages/blog/_authors
    media_folder: ""
    public_folder: ""
    format: json
    create: true
    slug: "{{name}}"
    path: "{{name}}/index"
    fields:
      - label: Name
        name: name
        widget: string
      - label: Title
        name: title
        widget: string
      - label: Email
        name: email
        widget: string
      - label: Shortbio
        name: shortbio
        widget: text
      - label: Image
        name: authorimage
        widget: image
      - label: URL
        name: url
        widget: string
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - name
      - name
    view_filters: []
    view_groups: []
  - name: legal
    label: Legal
    folder: content/legal
    media_folder: ""
    public_folder: ""
    create: true
    slug: "{{fields.slug}}"
    fields:
      - label: Title
        name: title
        widget: string
      - label: Publish Date
        name: date
        widget: datetime
      - label: Description
        name: description
        widget: string
      - label: Body
        name: body
        widget: markdown
      - label: Slug
        name: slug
        widget: string
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - date
      - commit_author
      - description
    view_filters: []
    view_groups: []
slug:
  encoding: unicode
  clean_accents: false
  sanitize_replacement: "-"
isFetching: false
error: null

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions