Skip to content

Bad error messages (Svelte 5 & 4) #10288

Open
@KevsRepos

Description

@KevsRepos

Describe the bug

When referencing properties of undefined state, you'll get a "cryptic" error message: get(...) is undefined, which is not very helpful while debugging. Filed as a Bug because I think exposing errors that reference the compiled code, is not the intended way of describing problems with the code to the dev.

Keep in mind that this is not only Svelte 5 specific. Svelte 4 also has these cryptic errors like ctx[0] is undefined. It'd be nice if Svelte 5 finally fixes this.

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAA42PQU_DMAyF_4qxdgBpbe-lm4S48B8oh9C4zFIaR4k3bar630lTMQ5cOD77PT9_M47sKGH7PqM3E2GLLyHgHvUWVpEu5JSyTnKOwzrp0hA56LH3vfIUJCq8nthZGKNM0GPdFFlvyR6fszFbHSkMxXeAXVKj9PiUV13ze85326FP9rbVE6fDXBILNGW9qTpECRT1tkD3UFVgrAXjQYKyeONyiWHP_gtWl1GJoAIjX6GqjpljEssjk8VW45mW_R27dP8XnK4FfBCfFH4eymQ9vpFzUqjvaH9bP5ZvR6JTq3gBAAA=

Logs

No response

System Info

System:
    OS: Linux 6.5 Pop!_OS 22.04 LTS
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
    Memory: 7.08 GB / 15.32 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 19.3.0 - ~/.nvm/versions/node/v19.3.0/bin/node
    npm: 9.2.0 - ~/.nvm/versions/node/v19.3.0/bin/npm
  Browsers:
    Chrome: 119.0.6045.199
    Firefox: 120.0

Severity

annoyance

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