-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Cannot read property '_pending' of null" when using transition component. #8199
Comments
As a workaround, you can key the span with the |
FYI this bug is introduced in 0f2cb09 & 2839e31 It only appears in a specific scenario when the root node of a conditional rendering expression is reused and the new root sets its For reused DOM nodes, Vue calls The DOM node is reused only when |
If the new parentNode gets a `textContent` or `innerHTML` property during patching, the `transition` node would have been detached early, which means `el.parentNode` no longer exists.
fix #8199 * fix(transition): check existence of `el.parentNode` If the new parentNode gets a `textContent` or `innerHTML` property during patching, the `transition` node would have been detached early, which means `el.parentNode` no longer exists. * fix(vdom): should not reuse nodes with `textContent` / `innerHTML` props
fix vuejs#8199 * fix(transition): check existence of `el.parentNode` If the new parentNode gets a `textContent` or `innerHTML` property during patching, the `transition` node would have been detached early, which means `el.parentNode` no longer exists. * fix(vdom): should not reuse nodes with `textContent` / `innerHTML` props
fix vuejs#8199 * fix(transition): check existence of `el.parentNode` If the new parentNode gets a `textContent` or `innerHTML` property during patching, the `transition` node would have been detached early, which means `el.parentNode` no longer exists. * fix(vdom): should not reuse nodes with `textContent` / `innerHTML` props
Version
2.5.16
Reproduction link
https://jsfiddle.net/6sny3yq9/
Steps to reproduce
What is expected?
When the value of the input field is "foo" the computed property
bar
will evaluate to true and the "a" span will display.When the user changes the value in the input field from "foo" to anything else, the computed property
bar
will evaluate to false and the "b" span (rendered using v-html) will display.What is actually happening?
Initially, the value of the input field is "foo" and the computed property
bar
is evaluated to true, so the "a" span is displaying.But, when the user changes the value in the input field from "foo" to anything else, Vue crashes and this error message is displayed: Error in nextTick: "TypeError: Cannot read property '_pending' of null"
It takes this very specific scenario for the error to appear. In the fiddle, I've shown that by removing the
@click="show = !show"
event listener, Vue works as expected with no errors.Here are three other changes that, when made individually, result in Vue working as expected:
<transition>
component surrounding the "a" span<span v-else>{{ b }}</span>
instead of<span v-else v-html="b"></span>
v-show="bar"
andv-show="!bar"
instead of thev-if="bar"
andv-else
directivesFound via this question on Stack Overflow:
https://stackoverflow.com/questions/50400131/cannot-read-property-pending-of-null-when-using-v-html-and-transition#
The text was updated successfully, but these errors were encountered: