Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&a... #3962

Closed
sheldonhull opened this issue Jun 29, 2020 · 14 comments
Labels
status: unconfirmed type: bug code to address defects in shipped code

Comments

@sheldonhull
Copy link

Describe the bug

ReactJS

To Reproduce

I can't open my cms instance and not sure what to do.
I'm guessing it's some issue parsing dates from the front-matter, but not sure.
I want to use date tokens.

I removed this for example to try and test the slug generation, but it didn't seem to impact anything.

- slug: '{{year}}-{{month}}-{{day}}t{{Hour}}-{{Minute}}-00-00'

I also removed this from collections.item.fields.label.format format: YYYY-MM-DD HH:00:00 +-HH:mm

Expected behavior

Open CMS without issue, and see the list of posts.

Screenshots
none.

Applicable Versions:

  • Netlify CMS version: [email protected]
  • Git provider: git-gateway
  • Browser version: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36

CMS configuration

public_folder: /static/images
media_folder: static/images
slug:
  encoding: unicode
  clean_accents: false
  sanitize_replacement: "-"
editor:
  preview: false
display_url: https://www.sheldonhull.com
publish_mode: editorial_workflow
backend:
  name: git-gateway
  branch: master
  squash_merges: true
collections:
  - view_filters: []
    identifier_field: title
    meta: {}
    name: microblog
    slug: "{{year}}-{{month}}-{{day}}-{{Hour}}-{{Minute}}"
    folder: content/microblog
    publish: true
    sortableFields:
      - commit_date
      - title
      - date
      - commit_author
    label: micro.blog
    format: yaml-frontmatter
    fields:
      - label: title
        name: title
        widget: datetime
        required: true
      - label: Publish Date
        name: date
        widget: datetime
        required: true
      - label: Body
        name: body
        widget: markdown
        required: true
      - label: Tags
        name: tags
        widget: list
        default:
          - tech
          - til
        multiple: true
        required: true
        allow_add: true
        options:
          - til
          - development
          - sql-server
    create: true
    extension: md
  - view_filters: []
    meta: {}
    name: blog
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    folder: content/blog
    publish: true
    sortableFields:
      - commit_date
      - title
      - date
      - commit_author
    label: blog
    format: yaml-frontmatter
    fields:
      - label: Title
        name: title
        widget: string
        tagname: h1
        required: true
      - label: slug
        name: slug
        widget: string
        tagname: h1
        required: true
      - label: Publish Date
        name: date
        widget: date
        format: YYYY-MM-DD
        required: true
      - label: Last Modified Date
        name: last_modified_at
        widget: date
        format: YYYY-MM-DD
        required: true
      - label: Body
        name: body
        widget: markdown
        required: true
      - label: toc
        name: toc
        widget: boolean
        default: true
      - label: Excerpt
        name: excerpt
        widget: string
        required: true
      - label: Cover Image
        name: image
        widget: image
        required: false
        tagname: null
      - label: Tags
        name: tags
        widget: select
        default: tech
        options:
          - til
          - development
          - sql-server
        multiple: true
        required: true
        allow_add: true
      - name: docs
        label: docs
        folder: content/docs
        format: yaml-frontmatter
        extension: md
        create: true
        slug: "{{ slug }}"
        fields:
          - label: Title
            name: title
            widget: string
            tagname: h1
            required: true
          - label: slug
            name: slug
           
...
@erezrokah erezrokah added type: bug code to address defects in shipped code status: unconfirmed labels Jun 30, 2020
@erezrokah
Copy link
Contributor

Hi @sheldonhull, can you share a screen shot of the error screen? Does it happen in the preview pane or you can't even login to the CMS?
Also, can you share a step by step reproduction and the full config.yml?

@sheldonhull
Copy link
Author

I included the config above.
It begins to load, but fails during parsing some files I believe, guessing it's something to die with datetime parsing.

The full react error from the failure is linked above already. The actual error is better as its truncated on the error page and said to use that link for the full error.

Does that clarify?

@erezrokah
Copy link
Contributor

I included the config above.

The config in the issue is truncated.

It begins to load, but fails during parsing some files I believe, guessing it's something to die with datetime parsing.

Parsing of dates occurs in multiple places in the CMS, thus the request for a screen shot and a step by step guide. Preferably with a clean browser session.

The full react error from the failure is linked above already

The linked error explains the error, but doesn't provide much information on where it originated from.

@sheldonhull
Copy link
Author

sheldonhull commented Jun 30, 2020

Cool. Here's the config file, I'll have to grab the others when I'm back in my system and try to reproduce

https://www.github.com/sheldonhull/sheldonhull.hugo/tree/master/static%2Fcms%2Fconfig.yml

And for clarity on the step by step.... I authenticate, and immediately it fails. I'm not able to do anything other than sign-in. I'll look for the screenshot too

@sheldonhull
Copy link
Author

Screenshot_20200630-041925

Here's a quick shot from mobile. Loading entries shows up then a failure and this, can't proceed. Did that help?

@erezrokah
Copy link
Contributor

Can you share the full URL of that page?

@sheldonhull
Copy link
Author

Can you share the full URL of that page?

I'm sorry what page? I provided the full react error link at top. Are you referring to where I've placed my cms index.html? That would be sheldonhull.com/cms

@erezrokah
Copy link
Contributor

Sorry, I meant which blog post shows that error?

@sheldonhull
Copy link
Author

It didn't tell me. I enabled developer tools in the hope that I could see it process these, and did find out a specific file it stopped on.
It seems that the source file might be 2019-05-16t11-15-28-05-00.md as this is the only file that has the matching timestamp in the front matter.

The last item in developer tools that shows up is a blob that shows the following content:

{
  "sha": "155ace05d980f1ce350d9e055ce4092acc58a1ce",
  "node_id": "MDQ6QmxvYjE3NzIzNjQxOToxNTVhY2UwNWQ5ODBmMWNlMzUwZDllMDU1Y2U0MDkyYWNjNThhMWNl",
  "size": 220,
  "url": "https://api.github.com/repos/sheldonhull/sheldonhull.hugo/git/blobs/155ace05d980f1ce350d9e055ce4092acc58a1ce",
  "content": "LS0tCnRpdGxlOiAyMDIwLTA1LTE1VDE2OjA5OjIyKzAwOjAwCmRhdGU6IDIw\nMjAtMDUtMTUgMTY6MDA6MDAgKzAwOjAwCnRhZ3M6Ci0gdGVjaAotIHdvcmst\nZnJvbS1ob21lCgotLS0K4pyUIEFuaW1hdGVkIGEgZnV6enkgdGlja2xlIGNy\nZWF0dXJlLiAKCuKclCBSZXNjdWUgYSBiaXJkIHN0dWNrIGluIGEgdmVudCAK\nCuKclCBCZWdpbiBEZXZPcHMgeWFraW5nIHNoYXZpbmcgc2Vzc2lvbg==\n",
  "encoding": "base64"
}

@sheldonhull
Copy link
Author

@erezrokah just a quick follow-up to see if this gave you what you needed. I wanted to check out the updates in netlify cms for branch based publishing, but this is blocking me from being able to load. I'm not certain how the parsing for dates is handled, as I have a mix of date formats over time, and would like to ensure it doesn't panic on failure of a front matter parsing.

sheldonhull added a commit to sheldonhull/sheldonhull.hugo that referenced this issue Jul 1, 2020
- Want to see if it will load as it is panic on load. See decaporg/decap-cms/issues/3962
@sheldonhull
Copy link
Author

Ok, so I removed the entire section in question and the remainder content did load, so it's definitely an issue in the parsing of the those "microblog" entries and likely the dates. What's the next step?

@erezrokah
Copy link
Contributor

erezrokah commented Jul 2, 2020

Hi @sheldonhull, I'm still not sure where that error appears.
I was able to load the CMS with the microblog (just by reverting the comments in the config).
image

image

image

Can you share the full URL in the address for the broken entry? An example for that would be http://localhost:5000/cms#/collections/microblog/entries/2019-05-16t11-15-28-05-00

sheldonhull added a commit to sheldonhull/sheldonhull.hugo that referenced this issue Jul 2, 2020
sheldonhull added a commit to sheldonhull/sheldonhull.hugo that referenced this issue Jul 2, 2020
@erezrokah
Copy link
Contributor

Closing, please comment if still relevant

@sheldonhull
Copy link
Author

Thank you for your assistance. The issues seems to no longer be persisting as I've played around with the adjustments on the config. So far everything is good. If I find the error happens again, I'll update this with further details. Thanks for your time! 🌮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: unconfirmed type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants