Skip to content

Regression: 'state' as a computed property name throws an exception #1012

Closed
@ChrisTalman

Description

@ChrisTalman

Svelte 1.47.1 seems to trip up when it encounters a computed property with the name state.

This is demonstrated here.

I had been using a previous version of Svelte, but when I updated to 1.47.1, this exception appeared.

Obviously, state means something to Svelte internally, but it was possible to use this as a property name prior to 1.47.1 (or an earlier version), and it is useful to be able to do.

I have also included a stack trace below if that is of any help.

Stack Trace

Uncaught TypeError: state is not a function
at Component._recompute (app.js:42181)
at new Component (app.js:42151)
at create_main_fragment (app.js:95787)
at new Component (app.js:96512)
at create_if_block (app.js:95365)
at Object.update [as p] (app.js:95269)
at Component._set (app.js:8411)
at Object.update [as p] (app.js:112328)
at Object.update [as p] (app.js:112272)
at Component._set (app.js:8411)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions