You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In svelte 3 it should be possible to use bind:this in a loop (cf sveltejs/svelte#368)
but I get a compilation error when I bind a component in the loop
I get the error :
ERROR in ./src/Main.svelte
Module build failed (from ./node_modules/svelte-loader/index.js):
Error: TypeError: TypeError: Cannot read property 'name' of null
at preprocess.then.catch.err (/home/oli/Documents/bakino/work/svelte_bug/node_modules/svelte-loader/index.js:180:12)
at <anonymous>
@ ./src/app.js 1:0-34 14:15-19
Here is a sample code to reproduce :
Component Todo.svelte
<script>exportlettodo</script><div>
I am a todo {todo.name}
</div>
Component Main.svelte
<script>importTodofrom'./Todo.svelte';exportletdata={todos: []};lettodos=[];</script><div><h1>A todo list</h1>
{#each data.todos as todo, i}
<div><!-- the bind:this={todos[i]} generate the error, remove it and no more error --><Todotodo={todo}bind:this={todos[i]}></Todo></div>
{/each}
</div>
In svelte 3 it should be possible to use bind:this in a loop (cf sveltejs/svelte#368)
but I get a compilation error when I bind a component in the loop
I get the error :
Here is a sample code to reproduce :
Component Todo.svelte
Component Main.svelte
app.js
webpack config
The text was updated successfully, but these errors were encountered: