Skip to content

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Aug 26, 2025

If flushSync is called while flushing effects, it creates an inner flush cycle which in turn may also call flush_queued_effects, at which end eager_block_effects will be set to null. This fixes that by adding optional chaining.

fixes #16640, though in async mode this would be an error anyway and that's probably a separate discussion how to fix that or if we even want to (the error message is there for deliberate reasons).

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.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset).

Tests and linting

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

Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: 6ef52d1

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

Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@16674

@dummdidumm dummdidumm marked this pull request as ready for review August 26, 2025 14:48
@Rich-Harris Rich-Harris merged commit bde51ed into main Aug 26, 2025
17 checks passed
@Rich-Harris Rich-Harris deleted the flush-sync-effects-fix branch August 26, 2025 19:59
@github-actions github-actions bot mentioned this pull request Aug 26, 2025
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.

Cannot read properties of null (reading 'length') after updating svelte from 5.38.1 to 5.38.2
2 participants