### Vue version 3.4.23 ### Link to minimal reproduction https://play.vuejs.org/#__PROD__eNqVU8tu2zAQ/JUtL4lRW2qbnFzJ6AM5tIe2aHoUUCjSWmJCkQQfig1D/96lKDlOkQTIxRZ3ZrjD5fDAPmud9B7ZmmW2Mlw7sOi83hSSd1oZBwcwuIUBtkZ1cEbUs49H7Kvq9AQkaViErQJeKWlpp1bdj5Q87HHujMdFIbM0NqIWtHDYaVE6pFXWXm6uHWq7zlL6pIIS9AuQCb7xFkEbVfvKcSXBeOl4h9CpGrOU8JlX1jW0rhNQqa5D6YBLcCgw+H1ErNpSNgil3IN1ZCAQSaOVJNUSnOFNgwZci+B1TYRH6hqtU2b/oJjQLB09Z6EO/Ypv84LNYygYpAG7MdO/d46O8qkSvLo74eXbUlgs2FNNomZsdDI5tmTO0sy3vElurZJ0m4fgtGBBygWanzqMzRZsDSMSsFIIdf99rIWrWc71qsXq7on6rd2FWsF+GbRoerJ4xFxpGnQRvrr+gTv6PoJ0SV4Q+wXwN1olfPAYaV+8rMn2CW90+23MHZfNH3u1cyjtfKhgNDCHkV8wymEY5XNHf7B7kVyOukIONMU5w698DjHulaJQUmRi2t9R1GOdy8pgSfnN4XwB+WYmJn0pPMLbHN6/9Cpq3tPfpKEzHI6NhgGeDdPclGJ07D/pzmOeY+wXp5maHwo4RVvcqHpPcqq/Wa2m57RaTdmLxHERDf4fyL89mnA9NEqacfLhgg3/ADMdheU= ### Steps to reproduce 1. switch to production runtime mode 2. use teleport in a component 3. add a top level html comment in the teleport 4. change any state in the component, trigger update 5. destory the component ### What is expected? The component should be destoryed. ### What is actually happening? Got a TypeError. Whole app is broken. Error message: `TypeError: Cannot read properties of null (reading 'parentNode')`  ### System Info _No response_ ### Any additional comments? The bug is only reproduced in production mode.
Vue version
3.4.23
Link to minimal reproduction
https://play.vuejs.org/#__PROD__eNqVU8tu2zAQ/JUtL4lRW2qbnFzJ6AM5tIe2aHoUUCjSWmJCkQQfig1D/96lKDlOkQTIxRZ3ZrjD5fDAPmud9B7ZmmW2Mlw7sOi83hSSd1oZBwcwuIUBtkZ1cEbUs49H7Kvq9AQkaViErQJeKWlpp1bdj5Q87HHujMdFIbM0NqIWtHDYaVE6pFXWXm6uHWq7zlL6pIIS9AuQCb7xFkEbVfvKcSXBeOl4h9CpGrOU8JlX1jW0rhNQqa5D6YBLcCgw+H1ErNpSNgil3IN1ZCAQSaOVJNUSnOFNgwZci+B1TYRH6hqtU2b/oJjQLB09Z6EO/Ypv84LNYygYpAG7MdO/d46O8qkSvLo74eXbUlgs2FNNomZsdDI5tmTO0sy3vElurZJ0m4fgtGBBygWanzqMzRZsDSMSsFIIdf99rIWrWc71qsXq7on6rd2FWsF+GbRoerJ4xFxpGnQRvrr+gTv6PoJ0SV4Q+wXwN1olfPAYaV+8rMn2CW90+23MHZfNH3u1cyjtfKhgNDCHkV8wymEY5XNHf7B7kVyOukIONMU5w698DjHulaJQUmRi2t9R1GOdy8pgSfnN4XwB+WYmJn0pPMLbHN6/9Cpq3tPfpKEzHI6NhgGeDdPclGJ07D/pzmOeY+wXp5maHwo4RVvcqHpPcqq/Wa2m57RaTdmLxHERDf4fyL89mnA9NEqacfLhgg3/ADMdheU=
Steps to reproduce
What is expected?
The component should be destoryed.
What is actually happening?
Got a TypeError. Whole app is broken.
Error message:
TypeError: Cannot read properties of null (reading 'parentNode')System Info
No response
Any additional comments?
The bug is only reproduced in production mode.