diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index 902a0d9756..c4d18ec4ce 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -881,7 +881,7 @@ export default class Component { const { name } = declarator.id; const variable = component.var_lookup.get(name); - if (variable.export_name) { + if (variable.export_name && variable.writable) { const insert = variable.subscribable ? get_insert(variable) : null;