Vue: Transition Functional comp causes error in Jest tests: Cannot read property '_isDestroyed' of undefined

Created on 4 Apr 2019  路  5Comments  路  Source: vuejs/vue

Version

2.6.10

Reproduction link

https://github.com/Akryum/vue-issue-test-transition-functional

Steps to reproduce

Using a <transition> on a stubbed functional component is throwing an error during the unit tests with Jest (using shallowMount).

Examples: Component | Test

In the reprod, run:

yarn install
yarn run test:unit

What is expected?

No error in the console

What is actually happening?

The tests pass but an error is displayed in the console:

[Vue warn]: Error in nextTick: "TypeError: Cannot read property '_isDestroyed' of undefined"

Position of the error


Not sure if this should be fixed in Vue core or Vue test utils.

In Vue core, a quick fix would be to check if componentInstance is defined on the vnode here.

Most helpful comment

We see this in static site generated by Nuxt.js. This only happens on page refresh.

All 5 comments

Note: workaround is manually stubbing the functional component in the test. This makes the error disappear.

@eddyerburgh maybe you know where this comes from 馃檪

Getting this error in the production environment
Difficult to debug as in happens only on Static version of the site.

image

We see this in static site generated by Nuxt.js. This only happens on page refresh.

Happening on my side with Jest test when I use provide/inject and render function instead of template :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loki0609 picture loki0609  路  3Comments

paceband picture paceband  路  3Comments

finico picture finico  路  3Comments

julianxhokaxhiu picture julianxhokaxhiu  路  3Comments

robertleeplummerjr picture robertleeplummerjr  路  3Comments