Markdown plugins cause runtime error if not present or incompatible in Planka #727

Closed
opened 2026-02-04 21:06:54 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @symonbaikov on GitHub (Jun 6, 2025).

When enabling certain markdown plugins in client/src/configs/markdown-plugins/index.js (for example, plugins from @gravity-ui/markdown-editor/markdown-it/* or @diplodoc/transform/lib/plugins/*), and clicking on the third button:

Image

the application crashes with the following error in the browser console:

Uncaught TypeError: Cannot read properties of undefined (reading 'warn')
    at default (markdown-to-text.js:...)
    ...

Details:
The error occurs if a plugin is missing from node_modules or is incompatible with the current markdown parser version.
The problem is not visible at build time, but causes a runtime crash when rendering markdown (especially in list view).
Disabling all external plugins and leaving only local ones (like link and mention) resolves the issue.
The error is triggered by the markdown parser trying to call methods on undefined plugins.

Steps to reproduce:
Add any non-existent or incompatible plugin import to markdown-plugins/index.js.
Add it to the exported plugins array.
Open any board and switch to list view (or any view that renders markdown).
Observe the runtime error in the browser console.

Expected behavior:
The application should either:
Fail gracefully if a plugin is missing or incompatible (with a clear error message),
Or provide a way to validate plugin existence/compatibility at build time.

Image
Originally created by @symonbaikov on GitHub (Jun 6, 2025). When enabling certain markdown plugins in client/src/configs/markdown-plugins/index.js (for example, plugins from @gravity-ui/markdown-editor/markdown-it/* or @diplodoc/transform/lib/plugins/*), and clicking on the third button: ![Image](https://github.com/user-attachments/assets/eda40b42-abd8-40c9-becc-358c1880b642) the application crashes with the following error in the browser console: ```javascript Uncaught TypeError: Cannot read properties of undefined (reading 'warn') at default (markdown-to-text.js:...) ... ``` **Details:** The error occurs if a plugin is missing from node_modules or is incompatible with the current markdown parser version. The problem is not visible at build time, but causes a runtime crash when rendering markdown (especially in list view). Disabling all external plugins and leaving only local ones (like link and mention) resolves the issue. The error is triggered by the markdown parser trying to call methods on undefined plugins. **Steps to reproduce:** Add any non-existent or incompatible plugin import to markdown-plugins/index.js. Add it to the exported plugins array. Open any board and switch to list view (or any view that renders markdown). Observe the runtime error in the browser console. **Expected behavior:** The application should either: Fail gracefully if a plugin is missing or incompatible (with a clear error message), Or provide a way to validate plugin existence/compatibility at build time. <img width="1725" alt="Image" src="https://github.com/user-attachments/assets/49929e05-87c8-46a6-991d-e99e9f584533" />
Author
Owner

@symonbaikov commented on GitHub (Jun 6, 2025):

After step-by-step testing, I found that the problem is caused by the note plugin (@diplodoc/transform/lib/plugins/notes).
When this plugin is enabled in client/src/configs/markdown-plugins/index.js, the application crashes with the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'warn')
    at default (markdown-to-text.js:...)
    ...

Disabling the note plugin resolves the issue and the markdown rendering works correctly.
It seems that either the plugin is not compatible with the current markdown parser version, or it is missing or broken in the current environment.

@symonbaikov commented on GitHub (Jun 6, 2025): After step-by-step testing, I found that the problem is caused by the `note` plugin (`@diplodoc/transform/lib/plugins/notes`). When this plugin is enabled in client/src/configs/markdown-plugins/index.js, the application crashes with the following error: ```javascript Uncaught TypeError: Cannot read properties of undefined (reading 'warn') at default (markdown-to-text.js:...) ... ``` Disabling the note plugin resolves the issue and the markdown rendering works correctly. It seems that either the plugin is not compatible with the current markdown parser version, or it is missing or broken in the current environment.
Author
Owner

@meltyshev commented on GitHub (Jun 6, 2025):

Thanks for reporting! Fixed.

@meltyshev commented on GitHub (Jun 6, 2025): Thanks for reporting! Fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#727