mirror of https://github.com/sveltejs/svelte
fix: show filename information in `legacy_recursive_reactive_block` (#13764)
parent
41d61c7a37
commit
8ff2af52d3
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: show filename information in `legacy_recursive_reactive_block`
|
@ -0,0 +1,12 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
compileOptions: {
|
||||||
|
dev: true
|
||||||
|
},
|
||||||
|
async test({ warnings, assert }) {
|
||||||
|
assert.deepEqual(warnings, [
|
||||||
|
'Detected a migrated `$:` reactive block in `main.svelte` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import { run } from 'svelte/legacy';
|
||||||
|
|
||||||
|
let count = $state(0);
|
||||||
|
|
||||||
|
run(() => {
|
||||||
|
count = count+1;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{count}
|
Loading…
Reference in new issue