Subscribe on changes!

Error in my code, is causing Vue internal error: "Unhandled error during execution of scheduler flush. This is likely a Vue internals bug"

avatar
Feb 2nd 2023

Vue version

3.2.38

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-7hq9fu?file=src/components/RawHtml.vue

Steps to reproduce

Open my stackblitz link and click the button 'Update Raw Html' two times. View error messages in console.

What is expected?

The first time the button is clicked, it causes an error (which is expected).

This is normal because my code has a bug (which I've fixed, but I've left in for this bug report; see additional comments).

Clicking the button second time should cause same error to reoccur.

What is actually happening?

Clicking the button a second time causes a Vue Internals error:

"Unhandled error during execution of scheduler flush. This is likely a Vue internals bug"

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
    Memory: 1.33 GB / 15.94 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 109.0.5414.120
    Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.76)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.2.31 => 3.2.38

Any additional comments?

I have fixed the error in my code, and, as a result, I no longer get the Vue Internals error either.

The fix to my error, is on line 38 in RawHtml.vue - just uncomment the line. My error was, I didn't reset the array, and so, Teleport component is unable to the correct element id.

What my component does:

I'm running traditional SSR page which receives html content over ajax requests. This html content may have dynamic vue components embedded within it.

RawHtml component is used instead of v-html, so I can separate the dynamic components from the html, render them independently, then Teleport the components back into their original locations within the html.