Skip to content

svelte 5: non enumerable property is removed in unstate #10315

@izznat

Description

@izznat

Describe the bug

Invoking unstate inside $derived results to a nested prop value removed.

Reproduction

Please look at the +page.svelte file in the repo below.
Reproduction

Steps:

  1. Open browser console, the error will occurs immediately.

Logs

+page.svelte:14 (3) ['hue', 'saturation', 'lightness']
+page.svelte:15 (3) ['hue', 'saturation', 'lightness'] 'unstate'
@zag-js_color-picker.js?v=0cf62db1:3391 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getChannels')
    at getAreaChannels (@zag-js_color-picker.js?v=0cf62db1:3391:32)
    at Object.getAreaProps (@zag-js_color-picker.js?v=0cf62db1:3519:38)
    at +page.svelte:43:26
    at chunk-QT3JEXLR.js?v=437d8e57:2652:47
    at execute_signal_fn (chunk-MPTA7GKG.js?v=437d8e57:539:7)
    at execute_effect (chunk-MPTA7GKG.js?v=437d8e57:668:31)
    at schedule_effect (chunk-MPTA7GKG.js?v=437d8e57:740:5)
    at internal_create_effect (chunk-MPTA7GKG.js?v=437d8e57:1243:5)
    at render_effect (chunk-MPTA7GKG.js?v=437d8e57:1315:10)
    at Module.spread_attributes_effect (chunk-QT3JEXLR.js?v=437d8e57:2651:3)

System Info

System:
    OS: Linux 6.6 Pop!_OS 22.04 LTS
    CPU: (8) x64 AMD Ryzen 3 5300U with Radeon Graphics
    Memory: 2.48 GB / 9.56 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 21.6.1 - ~/.proto/shims/node
    Yarn: 1.22.21 - ~/.proto/shims/yarn
    npm: 10.4.0 - ~/.proto/shims/npm
    pnpm: 8.14.3 - ~/.proto/shims/pnpm
  npmPackages:
    svelte: ^5.0.0-next.1 => 5.0.0-next.40

Severity

annoyance

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