[BUG] Uncaught (in promise): TypeError: fontFamily.replace is not a function on destroy action
See original GitHub issueHello, everybody.
Framework: Angular
Use case: textarea with tinymce Angular dicrective.
Tynymce package: “tinymce”: “^4.6.3”,
Issue: We have lifecycle method in Angular called onDestroy. This method invokes before Angular directive will be destroyed.
In this method I call editor.destroy()
method and have an Uncaught exception. Stack trace in below:
ERROR Error: Uncaught (in promise): TypeError: fontFamily.replace is not a function TypeError: fontFamily.replace is not a function at normalizeFontFamily (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:125611:25) at Object.getFontFamily (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:81726:16) at Editor.<anonymous> (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:125754:35) at Dispatcher.fire (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:104998:31) at Editor.fire (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:105238:41) at Object.nodeChanged (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:115690:18) at Editor.nodeChanged (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:119441:36) at Editor.<anonymous> (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:99843:18) at Dispatcher.fire (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:104998:31) at Editor.fire (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:105238:41) at Object.add (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:99931:18) at Editor.addNonTypingUndoLevel (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:99731:14) at Dispatcher.fire (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:104998:31) at Editor.fire (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:105238:41) at Editor.save (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:119855:16) at Editor.remove (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:120302:16) at Editor.destroy (http://localhost:8080/app/app.bundle-92563952a2c38322b634.js:120351:16)
This issue is actual only when my Tinymce textarea have been prepopulated with some text/html/etc. when directive created (i.e. tinymce textarea have editor.setContent() in the init_instance_callback
init config)
Expected result: No uncaught exception.
Do anyone have the same problem? It can be Angular integration issue as well.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:15 (3 by maintainers)
@Kuresov Yes, it is similar for me. But I mentioned that there is no error if tinymce didn’t have any initial value, only with some initialized value. So, this behavior can be named unstable.
Also I discovered, that in normal (no error) case
fontFamily
has string value like'Verdana, Arial, Helvetica, sans-serif'
but after destroy it has HTMLElement value of tinymce body element. So, it has different types and not seems like race condition.I am getting an similar issue “Uncaught TypeError: rawToolbar.replace is not a function” from theme.js (Version: 5.0.7). This is only reproducible when we load on mobile environment. Desktop environment works fine.