Skip to content

Svelte 5: Reintroduce frame/pos/toString() in compiler warnings #12151

@Conduitry

Description

@Conduitry

Describe the problem

Svelte 4 has some convenient fields on warnings that display the information in a human-readable way - but which are missing in Svelte 5. The frame contained some nearby context in the file and had a caret pointing at the position of the warning. The .toString() method was somewhat customized per type of warning, and would display some combination of the message, the filename, the line/column, the nearby code in the component, etc.

Describe the proposed solution

The simplest for consumers would be for the frame, pos, and toString() to be reimplemented as they were in v4, but there are other options here, too.

Importance

nice to have

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