Skip to content

Cannot read property 'subscribable' of undefined #6699

@mlefebvre-decathlon

Description

@mlefebvre-decathlon

Describe the bug

Hello everyone,

Since svelte version 3.41, we cannot compile code containing default values in destruct.

Compilation exits with Cannot read property 'subscribable' of undefined

<script> const myObject = {}; const { foo: { bar } = {} } = myObject; </script>

Svelte 3.40 : works fine
Svelte 3.41 : Error compiling component. Cannot read property 'subscribable' of undefined

This makes us rewrite all these assignements as :

const { bar } = myObject?.foo ?? {};

Did we miss something in the changelog ?

Reproduction

3.40.3 : https://svelte.dev/repl/3fa45ef9bff943d3acdee9ba35fbc577?version=3.40.3
3.41.0 : https://svelte.dev/repl/3fa45ef9bff943d3acdee9ba35fbc577?version=3.41.0
Current: https://svelte.dev/repl/3fa45ef9bff943d3acdee9ba35fbc577?version=latest

Logs

No response

System Info

Repl environment

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompilerChanges relating to the compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions