esbuild-plugin-elm
esbuild-plugin-elm copied to clipboard
Use async version of elm compiler to be able to get the error message
I want to be able to display the error message on the screen, for that I need to capture the error message produced during a compilation error, but this is not possible because the sync function from node-elm-compiler returns just a hardcoded string, as you can see here: https://github.com/rtfeldman/node-elm-compiler/pull/110
Since we are already in an async function, we might as well just use await here and get the proper error message
Unfotunately, as mentioned in #2, this can result in compilation failing occasionally due to corrupt builds.
I want to be able to display the error message on the screen
Can you elaborate a bit on this? The error messages generated by elm are piped through to stderr so not sure what you mean by this.
@phenax when I'm focusing on build the UI, I rely on hot reloading to refresh the screen, having just the code and the browser open side by side, so I wanted to display the errors in the DOM directly (like phoenix does when there is a backend error), with an overlay, not having to switch to the terminal
@rogeriochaves As mentioned in #2, this could lead to broken builds so I think this issue should be fixed upstream instead.