Skip to content

Infinite loop while binding an array to a child component #4325

@j3rem1e

Description

@j3rem1e

Describe the bug

I have two components :

Cpn.svelte

<script>
  export let items = [];
</script>

and a consumer :

<script>
  import Cpn from './Cpn';
  let items = []
</script>

<Cpn {items} bind:items/>

this consumer has a "bug" : it injects {items} and creates a binding with items. However svelte doesn't output any warning, and the generated code has an infinite loop when the component is rendered.

It "worked" in svelte 3.12

The bug is not really in svelte but in my code, however it's a "hard to debug" case, because chrome/firefox just crash every time the component is shown (and it worked in 3.12).

To Reproduce

I can't provide a REPL because this bug crashes the app.

Expected behavior

The generated code doesn't have an infinite loop/svelte emits an error.

Information about your Svelte project:

  • Chrome 79
  • Windows 7
  • Svelte 3.18.0
  • Webpack

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions