Skip to content

suggestion: stop scrapping DOM and model on error #360

Open

Description

@jligeza

Every time I make an error in code, the entire DOM (and model) is scrapped and replaced with an error report. It would be so much better if it worked like parcel - an overlay with error report is added, and when the error is fixed, the overlay is removed and the app updated with HMR. I think it would be even better if the error was only displayed in console - literally everything is better than resetting the model. With the current behavior, HMR is almost useless.

Activity

  1. halfzebra commented on Jul 29, 2019

    @halfzebra
    Owner

    Hello Jakub!

    Indeed this is a very good suggestion, I was looking into fixing this quite a while ago in it was not possible due to some internal webpack-related technical decisions. I will give this another stab when I'll have time and we'll see how it goes 🙂

  2. frou commented on Feb 3, 2020

    @frou

    This is big. As it stands, the user gets a major punishment for making any typo or error in their code. Hitting save is like Russian Roulette!

  3. halfzebra commented on Feb 3, 2020

    @halfzebra
    Owner

    Hi Duncan!

    Thank you for your feedback!
    I have a POC of error overlay working, but it requires maintaining a fork of https://github.com/facebook/create-react-app/tree/master/packages/react-error-overlay.
    With my current workload, I'm afraid it would be a very costly project to maintain.

    I have considered swapping the error overlay for https://github.com/xpl/panic-overlay, maybe it would be less of a risk to depend on the much smaller codebase. 🤔

    Let me know what you think!

  4. frou commented on Feb 3, 2020

    @frou

    Eduard - obviously you've thought about this way more than me. But what about, if in HMR mode, an Elm compiler error is simply shown in the Terminal only and not in the Browser? The Elm compiler errors are designed to be shown monospaced with ANSI colours, so they're not really at home in a GUI anyway.

  5. jligeza commented on Feb 4, 2020

    @jligeza
    Author

    It is much better DX to have errors on the overlay. People who are new to elm, maybe who start their first toy project with this tool, would especially appreciate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions