You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
suggestion: stop scrapping DOM and model on error #360
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.
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 🙂
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. 🤔
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.
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.
Activity
halfzebra commentedon Jul 29, 2019
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 🙂
frou commentedon Feb 3, 2020
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!
halfzebra commentedon Feb 3, 2020
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!
frou commentedon Feb 3, 2020
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.
jligeza commentedon Feb 4, 2020
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.