tinymce icon indicating copy to clipboard operation
tinymce copied to clipboard

Failed to load emoticons: Script at URL "..." failed to load

Open cowera opened this issue 7 years ago • 4 comments

I use ES2015 to load modules like described in the docs. Everything works as expected, however the emoticons plugin does not load. I get the following error:

Failed to load emoticons: Script at URL "..." failed to load

Not sure why this is, but I know I'm not the only one. This guy right here just recently had the same problem and found a workaround (just use Google Translate). But the workaround includes taking the emojis.js to a public dictionary, which is obviously not a solution.

cowera avatar Oct 27 '19 21:10 cowera

When using a module loader, you'll need to make sure you include any additional resource files in your imports list. So for the emoticons plugin, you'd need to do something like this (note the emojis database resource in the import list):

// Import TinyMCE
import tinymce from 'tinymce/tinymce';

// A theme is also required
import 'tinymce/themes/silver';

// Any plugins you want to use has to be imported
import 'tinymce/plugins/emoticons';
import 'tinymce/plugins/emoticons/js/emojis';

...

// Initialize the app
tinymce.init({
  selector: '#tiny',
  plugins: ['emoticons']
});

lnewson avatar Oct 27 '19 22:10 lnewson

Sorry for not being more specific, but what you just described is exactly what I am doing and that is working for all plugins except the emoticon one.

cowera avatar Oct 28 '19 06:10 cowera

@Hillcow can you please provide a codesandbox, or something similar to replicate the issue then? As I tested the above did work before posting.

lnewson avatar Oct 28 '19 06:10 lnewson

I run the latest version of Laravel and use Vue.js. I found out that it actually works if I import both of these:

import 'tinymce/plugins/emoticons/js/emojis.min'; import 'tinymce/plugins/emoticons';

cowera avatar Oct 28 '19 08:10 cowera