onDestroy hook not called on SSR since version 3.39.0 in production mode
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed in 3.42.3. Thanks for the speedy PR @dummdidumm!
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 realizedonDestroy
was called on the server