File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/svelte/src/legacy Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import * as w from '../internal/client/warnings.js';
1111import { DEV } from 'esm-env' ;
1212import { FILENAME } from '../constants.js' ;
1313import { 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
You can’t perform that action at this time.
0 commit comments