Subscribe on changes!

'type' not found inside unmountComponent

avatar
Dec 4th 2021

Version

3.2.23

Reproduction link

https://github.com/

Steps to reproduce

I couldn't reproduce the error in a new repo, but I know what triggers it.

Error Message:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'type')
    at unmountComponent (runtime-core.esm-bundler.js:4781)
    at unmount (runtime-core.esm-bundler.js:4697)
    at Object.remove (runtime-core.esm-bundler.js:5166)
    at unmount (runtime-core.esm-bundler.js:4708)
    at unmountChildren (runtime-core.esm-bundler.js:4825)
    at unmount (runtime-core.esm-bundler.js:4715)
    at unmountComponent (runtime-core.esm-bundler.js:4796)
    at unmount (runtime-core.esm-bundler.js:4697)
    at unmountChildren (runtime-core.esm-bundler.js:4825)
    at unmount (runtime-core.esm-bundler.js:4715)

I traced back to this line of code:

In development:

const unmountComponent = (instance, parentSuspense, doRemove) => {
                                                       // here VVVV
        if ((process.env.NODE_ENV !== 'production') && instance.type.__hmrId) {
            unregisterHMR(instance);
        }
        const { bum, scope, update, subTree, um } = instance;
        // beforeUnmount hook
        if (bum) {
            invokeArrayFns(bum);
        }
        // stop effects in component scope
        scope.stop();

In production:

TypeError: Cannot destructure property 'bum' of 'E' as it is null.

What is expected?

To find type in the instance

What is actually happening?

not finding type in the instance


This error triggers inside a parent component with slot. When I remove the template tag that injects the slot, the error stops

avatar
Dec 4th 2021

Hello, make sure to always provide a reproduction that follows the instructions at https://new-issue.vuejs.org/?repo=vuejs/vue-next#why-repro.

Open a new issue with a reproduction that follows those instructions if you manage to create a boiled down reproduction.