decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

TypeError: t.get is not a function

Open blairanderson opened this issue 5 years ago • 6 comments

Describe the bug

I converted by "body" element type from "markdown" to "code" and made no other changes.

I switched back from code to markdown and it fixed.

My body is written in html which is awkward using the markdown editor

To Reproduce

convert a widget from markdown to code

Expected behavior

I should see the html / code editor

Screenshots

Applicable Versions:

  • Netlify CMS version: [email protected]
  • Git provider: git-gateway
  • Browser version: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

CMS configuration

publish_mode: simple
slug:
  encoding: unicode
  clean_accents: false
  sanitize_replacement: "-"
backend:
  name: git-gateway
  branch: master
media_folder: assets
collections:
  - sortable_fields:
      - commit_date
      - title
      - date
      - commit_author
      - description
    view_filters: []
    meta: {}
    delete: false
    name: post
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    folder: _posts
    publish: true
    label: Post
    fields:
      - label: layout
        name: layout
        widget: hidden
        default: post
      - label: Title
        name: title
        widget: string
      - label: Description
        name: description
        widget: string
        required: false
      - label: Publish Date
        name: date
        widget: date
        default: "{{year}}-{{month}}-{{day}}"
      - label: type
        name: type
        widget: hidden
        default: post
      - label: published
        name: published
        widget: hidden
        default: "true"
      - label: status
        name: status
        widget: hidden
        default: publish
      - label: Upload Image
        name: thumbnail
        widget: image
      - label: Categories
        name: categories
        widget: list
        allow_add: true
      - label: Tags
        name: tags
        widget: list
        allow_add: true
      - label: Body
        name: body
        widget: code
    create: true
    sort: date:asc
    extension: html
public_folder: /assets

Additional context

blairanderson avatar Sep 21 '20 21:09 blairanderson

image

blairanderson avatar Sep 21 '20 21:09 blairanderson

Probably related to https://github.com/netlify/netlify-cms/issues/3524

erezrokah avatar Sep 22 '20 11:09 erezrokah

When creating a NEW post there is no react error on page load.

Filling out a post shows on error on save which says this:

image

blairanderson avatar Sep 22 '20 16:09 blairanderson

I have the exact same error spinning up a new site with jekyll, can't use code widget at all.

betaflag avatar Feb 23 '21 18:02 betaflag

Anyone got a fix for this?

tpluscode avatar Jul 15 '25 15:07 tpluscode

In my case I actually wanted to use code in a custom markdown widget but the principle is the same. It works when the value is empty, but throws in some cases if it should be populated with an existing, initial value

tpluscode avatar Jul 15 '25 15:07 tpluscode