Closed
Description
An empty component computed
property causes svelte compiler to add an unnecessary recompute
call without actually adding the recompute
function.
Version: 1.13.6
Smallest failing example:
<script>
export default {
computed: {}
}
</script>
Error: recompute is not defined.
Seems like the error is going on here: src/generators/dom/index.js#L305-L309
In order to resolve this issue I see one of two options:
- Check to see if
computed
is an empty object.- I think I'd prefer this more since I (personally) like to scaffold a component before adding in the computed properties.
- Throw a warning at build time that an empty object for
computed
is invalid.
I'll be happy to submit a PR, I just wanted to figure out the best course of action.
Metadata
Metadata
Assignees
Labels
No labels