tinymce / tinymce

The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular
https://www.tiny.cloud
Other
15.12k stars 2.24k forks source link

error when require executed into iframe #4684

Closed WebKieth closed 3 years ago

WebKieth commented 6 years ago

Do you want to request a feature or report a bug? bug report What is the current behavior? subj If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tinymce.com or similar. cant reproduce in fiddle cause its an iframe error What is the expected behavior? module will be require without errors Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE? "tinymce": "^4.9.0" - latest

No, i dont need to execute editor into iframe. I have some modules into my project on vue.js (browserify + vueify). In first module I dont use iframe but use editor. In second module - i use iframe without init tinymce. But all requires execute in all modules. When I route to module with iframe I had get error from text editor component on stroke:

const tinymce = require('tinymce/tinymce');

this is an error: TypeError: Cannot read property 'split' of undefined at URI.toAbsPath (tinymce.js:24363) at new URI (tinymce.js:24244) at URI.toAbsolute (tinymce.js:24309) at Object.setup (tinymce.js:25406) at tinymce.js:25700 at tinymce.js:26417 at Object. (tinymce.js:26418) at Object.179.timers (tinymce.js:26419) at o (_prelude.js:1) at _prelude.js:1

I solve the issue when wrap requiring into try/catch:

    try {
        const tinymce = require('tinymce/tinymce');
    } catch (err) {
        console.warn(err.message)
        return;
    }
fyrkant commented 6 years ago

When using tinymce with vue I'd recommend using our official wrapper: https://github.com/tinymce/tinymce-vue

WebKieth commented 5 years ago

@fyrkant i'm sure your official wrapper have the same problem. I use my own wrapper cause in this case tinymce dont require API key) I dont know why but it is

thedrjim commented 3 years ago

This issue has been closed due to inactivity. Tiny will soon be working with members of the community to close other old issues on our GitHub repositories. Please note the official support window for TinyMCE 4 is ending on December 31, 2020. If you haven't already upgraded to TinyMCE 5 it is highly encouraged that you do so. Upgrading will give you access to the latest releases and updates made to our WYSIWYG editor focused on bringing the latest UX and developer features into the editing experience. To assist with upgrading the editor we have put together a migration guide you can use here - https://www.tiny.cloud/blog/how-to-migrate-from-tinymce-4-to-tinymce-5/ If you have any questions or concerns, you can contact me at community-qa@tiny.cloud. You can also join the discussion on our mailing list at the following link: community-qa+subscribe@tiny.cloud.