question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[6.0] Media plugin + valid_elements = "TypeError: rule is undefined"

See original GitHub issue

What is the current behavior? Describe the bug Using media plugin with any valid_elements specification produces TypeError: rule is undefined

Please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tiny.cloud or similar. https://jsfiddle.net/r3c9jLp5/1/

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE? Version 6. Worked in previous version.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lnewsoncommented, Jun 6, 2022

The media elements are listed in the doc I linked, but yes it appears to be missing embed sorry. I’ll log an internal docs ticket to get that fixed. So to be clear the elements required by the media plugin are iframe, video, audio, embed and object (similar to how the lists plugin requires li, ul, ol, etc…). The media plugin itself has no way of blocking certain urls based on the type of URL provided so it needs to have all allowed. If you’d like to have that be customized so that it blocks certain media content that would need to be a separate feature request.

1reaction
TheSpydercommented, Jun 6, 2022

The exception looks like it’s coming from this code: https://github.com/tinymce/tinymce/blob/c12fb6af3b6b72886946dd3fb1bb1b8be249949f/modules/tinymce/src/plugins/media/main/ts/core/FilterContent.ts#L20-L29

So for now you need to define embed as a valid element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating from TinyMCE 5 to TinyMCE 6
Premium Plugins released with TinyMCE 6.0 are not backwards compatible with earlier ... TypeError: Cannot read properties of undefined (reading 'rows') .
Read more >
Uncaught TypeError: Cannot read properties of undefined ...
Hi, i have this kind of error in two my site with 6.1 Elementor pro version. Your tool is required for Elments Elementor...
Read more >
Uncaught TypeError: Cannot read property 'call' of undefined
Generally speaking this is an error that can be raised if you have set a non valid jQuery validation rule. You can find...
Read more >
Resolving TypeError: Cannot Read Property of Undefined ...
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
wp.media Uncaught TypeError: Cannot read properties of ...
But getting this error (Uncaught TypeError: Cannot read properties of undefined (reading 'state')) while submitting the image. constructor ( btn ) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found