Skip to content

reactivity broken (SvelteDate / new Date + setInterval) #14223

@5P5

Description

@5P5

Describe the bug

svelte reactivity is completely broken out of the box.

with import { SvelteDate } from 'svelte/reactivity' please see playground example.

  • h1 is reactive, as reasonably expected
  • h2 and h3 are both not reactive! (time not updating)
  • but like h4 that is suddenly reactive?!

なに??!!
is the behavior indented?
am I missing something?


bonus
change playground example

- let date=new SvelteDate()
+ let date=$state(new Date())

nothing updates at all.

according to Advanced Svelte / Advanced reactivity / Reactive built-ins that should work.

Reproduction

svelte.dev/playground

Logs

No response

System Info

all not working
- Chromium Version 129.0.6668.89 (Official Build) snap (64-bit)
- Firefox 132.0b5 20241008203725 mozilla-deb
- node v18.19.0

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions