decaporg / decap-cms

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

Error: Cannot resolve a DOM node from Slate node: {"text":""} #6999

Open Mishmcq opened 10 months ago

Mishmcq commented 10 months ago

Describe the bug

To Reproduce

Expected behavior

Screenshots

Applicable Versions:

CMS configuration


backend:
  name: github
  repo: Fuelweb/dishfun
  branch: main
  base_url: https://protected-plains-93496.herokuapp.com
  squash_merges: true
  site_url: https://www.dishfun.com
publish_mode: editorial_workflow
media_folder: assets/images
logo_url: https://www.fuelwebmarketing.com/assets/images/fuelweb-nobg.png
collections:
  - name: pages
    label: Pages
    folder: _pages
    create: true
    editor:
      preview: false
    summary: "{{titletag}}"
    fields:
      - label: Title (used for default url and netlify display)
        name: title
        widget: string
        required: true
      - label: Layout
        name: layout
        widget: string
        default: page-full
      - label: "Permalink (optional: link is named automatically from the title field)"
        name: permalink
        widget: string
        required: false
      - label: SEO Title Tag
        name: titletag
        widget: string
      - label: Description
        name: description
        widget: string
      - label: Body
        name: body
        widget: markdown
      - label: Sitemap
        name: sitemap
        widget: boolean
        default: true
        required: true
      - label: JSON Schema Markup
        name: schema
        widget: text
        required: false
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - commit_author
      - description
    view_filters: []
    view_groups: []
  - name: blog
    label: Blog
    folder: _blogposts
    create: true
    preview_path: blog/{{slug}}
    editor:
      preview: false
    view_groups:
      - label: Year
        field: date
        pattern: \d{4}
        id: date__\d{4}
    summary: "{{date}} - {{h1Headline}}"
    fields:
      - label: Title (used for url and netlify display)
        name: title
        widget: string
        required: true
      - label: Layout
        name: layout
        widget: hidden
        default: post
      - label: Publish Date
        name: date
        widget: datetime
        format: YYYY-MM-DD
        time_format: false
      - label: SEO Title Tag
        name: titletag
        widget: string
      - label: Description
        name: description
        widget: text
      - label: Author
        name: author
        widget: select
        options:
          - Michelle McHugh
          - Alfred Rasch
      - label: Featured Image
        name: featuredImage
        widget: image
      - label: Featured Image Alt Tag
        name: featuredImageAlt
        widget: string
      - label: "Permalink (optional: link is named automatically from the title field)"
        name: permalink
        widget: string
        required: false
      - label: "H1: H1 needs to go here for SEO"
        name: h1Headline
        widget: string
      - label: Body
        name: body
        widget: markdown
      - label: Sitemap
        name: sitemap
        widget: boolean
        default: true
        required: true
      - label: JSON Schema Markup
        name: schema
        widget: text
        required: false
    publish: true
    type: folder_based_collection
    sortable_fields:
      - commit_date
      - title
      - date
      - commit_author
      - description
    view_filters: []
  - name: salesbanner
    label: Sales Banner
    files:
      - label: Top Nav
        name: sales-banner
        file: _data/sales-banner.yml
        fields:
          - label: Text
            name: text
            widget: string
          - label: Start Date
            name: startDate
            widget: datetime
          - label: End Date
            name: endDate
            wid
...
martinjagodic commented 10 months ago

Hi @Mishmcq, please fill out all the fields in the issue template. The information you provided is not enough to debug the problem.

I'm closing the issue for now. Once you add the missing information, I can open it again.

vnourdin commented 10 months ago

Hi, I have the same problem in 3.0.12, when editing a markdown field (but not all), the browser crash on this error. I can't find what differs between this field and others.

Here are the console logs

Error: Cannot resolve a DOM node from Slate node: {"text":""}
    toDOMNode https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    toDOMPoint https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    toDOMRange https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    r https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    ln https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    us https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    cs https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Ol https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    unstable_runWithPriority https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Vi https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Tl https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    hl https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Yi https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    unstable_runWithPriority https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Vi https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Yi https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    Zi https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    ml https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    onChange https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
    apply https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js:485
decap-cms.js:485:2244126