question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Conduitrycommented, Aug 24, 2021

This should be fixed in 3.42.3. Thanks for the speedy PR @dummdidumm!

1reaction
benmccanncommented, Aug 24, 2021

I’m okay to revert it. The original motivation was to not call onMount on the server. I think it just slipped by us all and no one realized onDestroy was called on the server

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server-Side Rendering (SSR) - Vue.js
Vue.js is a framework for building client-side applications. By default, Vue components produce and manipulate DOM in the browser as output.
Read more >
React Hooks & SSR - ahooks 3.0
This article mainly introduces the common problems and solutions of React Hooks in SSR mode.
Read more >
Server-side rendering (SSR) with Angular Universal
This guide describes Angular Universal, a technology that renders Angular applications on the server. A normal Angular application executes in the browser, ...
Read more >
How to Enable Server-Side Rendering for a React App
First, use npx to start up a new React app using the latest version of Create React App. Let's call the app, react-ssr-example...
Read more >
Server-Side Rendering Optimization - Spartacus Documentation
Note: This feature is introduced with version 3.0 of the Spartacus libraries. ... Troubleshooting a Storefront That Is Not Running in SSR Mode;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found