-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
slot inside #if inside #each : TypeError cannot read property 'd' of null #2668
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
Comments
Such an intricate bug. Great find! The change handler of the each block has this code in it: p(changed, ctx) {
// ...
group_outros();
on_outro(() => {
if_block.d(1);
if_block = null;
});
if_block.o(1);
check_outros();
} And the change handler of the entire component has this code in it: p(changed, ctx) {
// ...
each_blocks = update_keyed_each(/* ... */);
check_outros();
} When |
I've had the same errors in |
I did try to add some null-checks to |
…-in-if-with-else-branch"
I'm getting this error in a keyed Steps to reproduce:
JS error in Console: |
Temporary fix for sveltejs/svelte#2668
The only workaround I've found to get around this issue is to move the
into the component. |
Just ran into the same variation as @fvsch. Here's a slightly smaller reproduction of the issue: https://svelte.dev/repl/35fdcf7ddad1403abf3ec6eeee108e57?version=3.4.4 Note that the problem goes away if you remove the key |
All three of the reproductions in this issue look to be fixed in 3.6.7, presumably by #3172. Closing. |
REPL link
Running this causes an error when an update is triggered by the reactive assignment in setTimeout:
Chrome: Uncaught (in promise) TypeError: Cannot read property 'd' of null
Safari: Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'if_block.d')
If the each block is not keyed (I remove (v)), there's no error.
The text was updated successfully, but these errors were encountered: