[Vuejs]-Vue and TinyMCE Issue

0đź‘Ť

âś…

Without seeing any code at all it is hard to say exactly why this is happening. Documenting how you are instantiating TinyMCE would help.

Based on the error message I would assume that you are using the TinyMCE Vue component/wrapper to inject TinyMCE into your Vue component. By default that does not actually load the core TinyMCE editor until run-time – and at that time it loads thing via the TinyMCE Cloud server.

The error you are seeing is your linting tool (eslint?) complaining that you are trying to call a variable tinymce but that variable is not defined anywhere.

There are a few ways you could choose to “fix” eslint complaining:

1 – Access tinymce through the global window object:

window.tinymce

2 – Wrap your code with a directive for eslint to not check for undefined variables:

/*eslint-disable no-undef*/
...
/*eslint-enable no-undef*/

https://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments

3 – Define a global in your .eslintrc file

{
  "globals": {
    "tinymce": true
  }
}

https://eslint.org/docs/user-guide/configuring#specifying-globals

Leave a comment