Skip to content

onDestroy hook not called on SSR since version 3.39.0 in production mode #6676

@cudr

Description

@cudr

Describe the bug

According documentation onDestroy hook must be called on server when component is destroyed. It looks like since version 3.39.0 it never gets called.

Reproduction

Clone repo: https://github.com/cudr/svelte-onDestroy-bug-repro then install dependencies and build.
Start project npm run start, go to main page and check terminal output (there are no console here).

If svelte is downgraded to 3.38.3 this will work fine and the onDestroy hook will be called.

Logs

No response

System Info

System:
    OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
  Binaries:
    Node: 16.6.1 - ~/.nvm/versions/node/v16.6.1/bin/node
    Yarn: 1.22.11 - ~/.nvm/versions/node/v16.6.1/bin/yarn
    npm: 7.20.3 - ~/.nvm/versions/node/v16.6.1/bin/npm
  Browsers:
    Firefox: 91.0.1
  npmPackages:
    svelte: ^3.42.2 => 3.39.0

Severity

blocking an upgrade

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