Skip to content

Very long error messages are cut off #44

@tom-sherman

Description

@tom-sherman

I ran into a very annoying error message with ReasonReact where I had a typo in a prop (onKeypress instead of onKeyPress). The most valuable part of the error message is at the bottom and I couldn't see it.

Repro: https://rescript-lang.org/try?code=LYewJgrgNgpgBAIQgF2SAdnAvHA3gKDjgAEAnGAQwGNkA6KkYABwxnWULlmTmAoGt4OABQA-BhHYAuOAEt2ASmwA+PJyIAeAEYo0mDAGkYATybkAzuay5hAfSVZVwhQF9VuYOYDmAWmUAlShpac2RSeS8XOA0Aeh1UDGVOF3wUoA

module Button = {
  @react.component
  let make = (~count: int) => {
    <button onKeypress={(_) => ()}> {msg->React.string} </button>
  }
}

image

This problem has several facets:

  1. The extension doesn't show the full message
  2. This error message is massive, but I understand why the full tuple might be helpful in some situations
  3. The most helpful piece of information is on the last line

I'm primarily a TS dev so I'm used to reading error messages from bottom to top, but I don't think it makes for the best experience - especially when compared to Rust for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions