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

ReferenceError Can't find variable: tinyMCE #485

Open
doug-wade opened this issue Mar 5, 2025 · 1 comment
Open

ReferenceError Can't find variable: tinyMCE #485

doug-wade opened this issue Mar 5, 2025 · 1 comment

Comments

@doug-wade
Copy link

Currently, I'm seeing the error ReferenceError Can't find variable: tinyMCE. I'm sure there's a problem with my setup that I can figure out independently, but I thought I'd point out that based on the code, I should instead be seeing tinyMCE is not loaded. If you customized TINYMCE_JS_URL, double-check its content. as my error message. The reason this is not happening is because when we reference the global variable tinyMCE, we don't prefix it with the scope that we want javascript to search for the global variable, so the error message assumes that we're missing a variable in the local scope. I think if we change the check to

    if (!globalThis.tinyMCE) {
      throw 'tinyMCE is not loaded. If you customized TINYMCE_JS_URL, double-check its content.';
    }

it should throw the expected error instead. See, for example, this quick test from my browser console:

Image

Here's the MDN docs for globalThis for reference, in case that helps clarify anything.

@claudep
Copy link
Contributor

claudep commented Mar 6, 2025

Thanks for the report, would you like to prepare a patch to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants