Netlify-cms: Markdown Widget "code-block" component => "Field Settings" => "MODE" => "codemirror/..." Cannot find module.

Created on 8 May 2020  路  3Comments  路  Source: netlify/netlify-cms

Hi,

I just updated Netlify CMS from v2.9.7 to v2.10.48 to resolve this issue: #3722

But I have another issue on Markdown Widget "code-block" component.

Describe the bug
When I try to select a "mode" from "Field Settings" using the "code-block" component I am getting an error as below. (Screenshots)

To Reproduce

  1. Go to a Markdown Widget and select a "code-block" component.
  2. Click to "Settings" icon. (right-top)
  3. Select a "MODE" from this "Field Settings" modal.
  4. Look at the console.

Expected behavior
Maybe a preview as highlighted for this component but have to add the language code to file => e.g. ```js

Screenshots
1- Select a Language
Screen Shot 2020-05-08 at 16 08 31

2- Console
Screen Shot 2020-05-08 at 15 44 48


Applicable Versions:

  • Netlify CMS version: 2.10.48
  • Git provider: GitHub
  • OS: MacOS
  • Browser version: Chrome Version 81.0.4044.129 (Official Build) (64-bit)

CMS configuration

```

  • label: "YYY"
    name: "yyy"
    folder: "xxx/yyy"
    create: true
    delete: false
    identifier_field: zzz
    fields:

    • {.........}

    • { required: true, label: "Content", name: "body", widget: "markdown", buttons: ["bold","italic","link","code-block","quote","bulleted-list","numbered-list","heading-two","heading-three","heading-four"], hint: "Content of this YYY", }

```

bug

All 3 comments

Screen Shot 2020-05-12 at 20 48 07

if (mode) {
    await Promise.resolve("codemirror/mode/".concat(mode, "/").concat(mode, ".js")).then(s => _interopRequireWildcard(require(s)));
}

Hi @furcan, this was merged but not released. The version on master branch is deployed here https://cms-demo.netlify.com/ so you cant test your use case there.

Hi @erezrokah
I have been tested and it seems to be ok.
Thanks for your support.
Have a nice day.

Was this page helpful?
0 / 5 - 0 ratings