Skip to content

Commit 8cae69b

Browse files
committed
revert
1 parent d4e0a9d commit 8cae69b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/svelte/src/legacy/legacy-client.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as w from '../internal/client/warnings.js';
1111
import { DEV } from 'esm-env';
1212
import { FILENAME } from '../constants.js';
1313
import { component_context, dev_current_component_function } from '../internal/client/context.js';
14+
import { async_mode_flag } from '../internal/flags/index.js';
1415

1516
/**
1617
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
@@ -120,8 +121,9 @@ class Svelte4Component {
120121
recover: options.recover
121122
});
122123

123-
// We don't flushSync for custom element wrappers or if the user doesn't want it
124-
if (!options?.props?.$$host || options.sync === false) {
124+
// We don't flushSync for custom element wrappers or if the user doesn't want it,
125+
// or if we're in async mode since `flushSync()` will fail
126+
if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {
125127
flushSync();
126128
}
127129

0 commit comments

Comments
 (0)