tinymce / tinymce-blazor

Blazor integration
MIT License
45 stars 14 forks source link

Uncaught Error: Node cannot be null or undefined #27

Closed rlebowitz closed 2 years ago

rlebowitz commented 2 years ago

We have been using the TinyMCE Blazor wrapper successfully in our application for some time now, but one of our developers encountered the following errors when he tried adding it to a new form. Th error appears after you type one letter.

Any ideas what would be causing this?

<Editor @ref="CheckEditor" ScriptSrc="./js/tinymce/tinymce.min.js" Conf="CheckEditorConfig" Disable="Model.DisableEditing" @bind-Value="@Model.ProblemData">

Uncaught Error: Node cannot be null or undefined at Object.Rt [as fromDom] (tinymce.min.js:9) at Wg (tinymce.min.js:9) at JE. (tinymce.min.js:9) at bE.fire (tinymce.min.js:9) at JE.fire (tinymce.min.js:9) at EE (tinymce.min.js:9) at Object.e (tinymce.min.js:9) at Oi.executeHandlers (tinymce.min.js:9) at HTMLBodyElement.d (tinymce.min.js:9) Rt @ tinymce.min.js:9 Wg @ tinymce.min.js:9 (anonymous) @ tinymce.min.js:9 bE.fire @ tinymce.min.js:9 fire @ tinymce.min.js:9 EE @ tinymce.min.js:9 e @ tinymce.min.js:9 Oi.executeHandlers @ tinymce.min.js:9 d @ tinymce.min.js:9 blazor.webassembly.js:1

   Uncaught (in promise) Error: System.ArgumentException: There is no tracked object with id '2'. Perhaps the DotNetObjectReference instance was already disposed. (Parameter 'dotNetObjectId')

at Microsoft.JSInterop.JSRuntime.GetObjectReference(Int64 dotNetObjectId) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson) at Object.endInvokeDotNetFromJS (blazor.webassembly.js:1) at Object.invokeJSFromDotNet (blazor.webassembly.js:1) at Object.w [as invokeJSFromDotNet] (blazor.webassembly.js:1) at _mono_wasm_invoke_js_blazor (dotnet.5.0.11.js:1) at do_icall (00aba242:0x194e4e) at do_icall_wrapper (00aba242:0x79df9) at interp_exec_method (00aba242:0x44ad3) at interp_runtime_invoke (00aba242:0x12efff) at mono_jit_runtime_invoke (00aba242:0x118e5f) at do_runtime_invoke (00aba242:0x79d42) endInvokeDotNetFromJS @ blazor.webassembly.js:1 invokeJSFromDotNet @ blazor.webassembly.js:1 w @ blazor.webassembly.js:1 _mono_wasm_invoke_js_blazor @ dotnet.5.0.11.js:1 $do_icall @ 00aba242:0x194e4e $do_icall_wrapper @ 00aba242:0x79df9 $interp_exec_method @ 00aba242:0x44ad3 $interp_runtime_invoke @ 00aba242:0x12efff $mono_jit_runtime_invoke @ 00aba242:0x118e5f $do_runtime_invoke @ 00aba242:0x79d42 $mono_runtime_try_invoke @ 00aba242:0x12982 $mono_runtime_invoke @ 00aba242:0x10ec2b $mono_wasm_invoke_method @ 00aba242:0x108e48 Module._mono_wasm_invoke_method @ dotnet.5.0.11.js:1 call_method @ dotnet.5.0.11.js:1 (anonymous) @ dotnet.5.0.11.js:1 beginInvokeDotNetFromJS @ blazor.webassembly.js:1 h @ blazor.webassembly.js:1 e.invokeMethodAsync @ blazor.webassembly.js:1 update @ tinymce-blazor.js:102 (anonymous) @ tinymce-blazor.js:126 bE.fire @ tinymce.min.js:9 fire @ tinymce.min.js:9 EE @ tinymce.min.js:9 e @ tinymce.min.js:9 Oi.executeHandlers @ tinymce.min.js:9 d @ tinymce.min.js:9 theme.min.js:9

   Uncaught TypeError: Cannot read properties of null (reading 'getRng')
at Pp (theme.min.js:9)
at theme.min.js:9
at Object.d (theme.min.js:9)
at p (theme.min.js:9)
at theme.min.js:9
at theme.min.js:9
exalate-issue-sync[bot] commented 2 years ago

Ref: INT-2690

jscasca commented 2 years ago

@rlebowitz my best guess here is that the theme is breaking the editor and when the wrapper can't find the editor it is throwing the no tracked object with id ....

What version of TinyMCE are you using? Have you tried running it from the cdn with the default theme?

If you can share a github project replication I can further look into it