-
-
Notifications
You must be signed in to change notification settings - Fork 324
Description
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:
Here's the MDN docs for globalThis for reference, in case that helps clarify anything.
