diff --git a/.changeset/ten-gifts-design.md b/.changeset/ten-gifts-design.md new file mode 100644 index 0000000000..a4e154fc9c --- /dev/null +++ b/.changeset/ten-gifts-design.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: don't add accessor twice diff --git a/packages/svelte/src/compiler/compile/render_dom/index.js b/packages/svelte/src/compiler/compile/render_dom/index.js index b2d02bb78c..0627e7e0cb 100644 --- a/packages/svelte/src/compiler/compile/render_dom/index.js +++ b/packages/svelte/src/compiler/compile/render_dom/index.js @@ -583,7 +583,11 @@ export default function dom(component, options) { }, {}); const slots_str = [...component.slots.keys()].map((key) => `"${key}"`).join(','); const accessors_str = accessors - .filter((accessor) => !writable_props.some((prop) => prop.export_name === accessor.key.name)) + .filter( + (accessor) => + accessor.kind === 'get' && + !writable_props.some((prop) => prop.export_name === accessor.key.name) + ) .map((accessor) => `"${accessor.key.name}"`) .join(','); const use_shadow_dom =