Skip to content

Commit d55c48f

Browse files
authored
Update packages/svelte/src/compiler/phases/2-analyze/index.js
1 parent 4f1ddff commit d55c48f

File tree

1 file changed

+1
-0
lines changed
  • packages/svelte/src/compiler/phases/2-analyze

1 file changed

+1
-0
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ export function analyze_component(root, options) {
268268
(declaration !== null &&
269269
// const state = $state(0) is valid
270270
get_rune(declaration.initial, instance.scope) === null &&
271+
// allow `import { derived } from 'svelte/store'` in the same file as `const x = $derived(..)` because one is not a subscription to the other
271272
!(
272273
name === '$derived' &&
273274
declaration.initial?.type === 'ImportDeclaration' &&

0 commit comments

Comments
 (0)