Skip to content

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Jan 25, 2024

Fixes #10296

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Copy link

changeset-bot bot commented Jan 25, 2024

🦋 Changeset detected

Latest commit: a3a3fc1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm dummdidumm changed the title failing test for #10296 fix: run onDestroy cleanup during SSR Feb 6, 2024
@dummdidumm
Copy link
Member

dummdidumm commented Feb 6, 2024

Dusted this off, implemented the fix and wondered why it still fails - turns out we're running the SSR tests in DOM mode, too. I had to add a separate vitest config to run the tests in a "real" server environment - couldn't find a better way to achieve this. Makes running the tests a bit more tedious and slower which is a shame, and given that they all run just fine in both environments we could scope this "real SSR environment" to a few specific tests only (for example only run the browser environemtn ssr tests in it). Open to suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onDestroy callbacks are not called during SSR
2 participants