Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Error insert image in markdown widget with multiple: true and choose_url: true #1110

Open
drweizak opened this issue May 1, 2024 · 0 comments

Comments

@drweizak
Copy link

drweizak commented May 1, 2024

This error occors when my markdown widget have the following properties:
{
label: "Texto",
name: "text",
widget: "markdown",
multiple: true,
choose_url: true,

}

multiple and choose_url are causing the issue.

Error when trying to insert an image in my markdown widget.
Already tried with different formats/extension and get the same error:

{extension: "mdx", format: "frontmatter",}

const config: Config = {
  local_backend: true,
  backend: {
    name: "github",
    repo: "drweizak/portugal-ferroviario",
    branch: "main",
    base_url: "https://portugal-ferroviario.vercel.app/",
    auth_endpoint: "api/auth",
  },
  media_folder: "public/images",
  media_library: {
    folder_support: true,
    max_file_size: 4096000,
  },
  public_folder: "/images",
  site_url: "https://portugal-ferroviario.vercel.app/",
  locale: "pt",
  slug: {
    encoding: "unicode",
    clean_accents: true,
    sanitize_replacement: "-",
  },
  collections: [
  {
  name: "publications",
  label: "Publicações",
  label_singular: "Publicação",
  folder: "content/publications/",
  format: "json",
  create: true,
  publish: true,
  delete: true,
  editor: {
    preview: true,
    size: "half",
    frame: false,
  },
  identifier_field: "metadata.title",
  slug: "{{slug}}_{{year}}_{{month}}_{{day}}",
  summary: "{{metadata.title}}",
  fields: [
    { name: "id", widget: "uuid", label: "ID", allow_regenerate: false },
    metadataCollection,
    {
      label: "Páginas",
      label_singular: "Página",
      name: "pages",
      widget: "list",
      required: false,
      types: [
      {
  name: "blank_page",
  label: "Página em Branco",
  widget: "object",
  summary: "{{fields.title}}",
  collapsed: true,
  fields: [
    { name: "type", default: "blank_page", widget: "hidden" },
    {
      name: "show_page_title",
      label: "Incluir Titulo da Seccção",
      default: true,
      widget: "boolean",
    },
        {
      label: "Texto",
      name: "text",
      widget: "markdown",
      multiple: true,
      choose_url: true,
      toolbar_buttons: {
        main: [
          "bold",
          "italic",
          "strikethrough",
          "font",
          "unordered-list",
          "ordered-list",
          "blockquote",
          "image",
          "file-link",
        ],
        selection: [
          "bold",
          "italic",
          "strikethrough",
          "font",
          "unordered-list",
          "ordered-list",
          "blockquote",
          "file-link",
        ],
        empty: ["image"],
      },
    },
  ],
}],
    },
  ],
};
  ],
};

Unhandled Runtime Error


TypeError: debouncedUrl.startsWith is not a function
Call Stack
useMediaAsset/<
node_modules\@staticcms\core\dist\static-cms-core.js (172861:0)
mountMemo
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (12112:0)
useMemo
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (12766:0)
useMemo
node_modules\next\dist\compiled\react-experimental\cjs\react.development.js (1813:0)
useMediaAsset
node_modules\@staticcms\core\dist\static-cms-core.js (172861:0)
ImageElement
node_modules\@staticcms\core\dist\static-cms-core.js (471270:0)
renderWithHooks
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (10806:0)
mountIndeterminateComponent
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (16487:0)
beginWork$1
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (18084:0)
callCallback
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (20199:0)
invokeGuardedCallbackImpl
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (20248:0)
invokeGuardedCallback
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (20323:0)
beginWork
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (26457:0)
performUnitOfWork
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (25286:0)
workLoopSync
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (25002:0)
renderRootSync
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (24967:0)
performSyncWorkOnRoot
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (24458:0)
flushSyncWorkAcrossRoots_impl
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (10123:0)
flushSyncWorkOnAllRoots
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (10081:0)
processRootScheduleInMicrotask
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (10225:0)
scheduleImmediateTask/<
node_modules\next\dist\compiled\react-dom-experimental\cjs\react-dom.development.js (10396:0)
@drweizak drweizak changed the title Error insert image in markdown widget Error insert image in markdown widget with multiple: true and choose_url: true May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant