diff --git a/packages/svelte/src/compiler/migrate/index.js b/packages/svelte/src/compiler/migrate/index.js
index c60d2c8719..89f03cc3e3 100644
--- a/packages/svelte/src/compiler/migrate/index.js
+++ b/packages/svelte/src/compiler/migrate/index.js
@@ -71,7 +71,7 @@ export function migrate(source) {
state = { ...state, scope: analysis.template.scope };
walk(parsed.fragment, state, template);
- const run_import = `import { run${state.run_name === 'run' ? '' : `as ${state.run_name}`} } from 'svelte/legacy';`;
+ const run_import = `import { run${state.run_name === 'run' ? '' : ` as ${state.run_name}`} } from 'svelte/legacy';`;
let added_legacy_import = false;
if (state.props.length > 0 || analysis.uses_rest_props || analysis.uses_props) {
diff --git a/packages/svelte/tests/migrate/samples/effects-with-alias-run/input.svelte b/packages/svelte/tests/migrate/samples/effects-with-alias-run/input.svelte
new file mode 100644
index 0000000000..0ee06dd18b
--- /dev/null
+++ b/packages/svelte/tests/migrate/samples/effects-with-alias-run/input.svelte
@@ -0,0 +1,14 @@
+
diff --git a/packages/svelte/tests/migrate/samples/effects-with-alias-run/output.svelte b/packages/svelte/tests/migrate/samples/effects-with-alias-run/output.svelte
new file mode 100644
index 0000000000..ac26da45e5
--- /dev/null
+++ b/packages/svelte/tests/migrate/samples/effects-with-alias-run/output.svelte
@@ -0,0 +1,22 @@
+
\ No newline at end of file