Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Warnings visible, even when elm-app start successfully compiles #15

Closed
undreren opened this issue Sep 23, 2016 · 12 comments
Closed

Comments

@undreren
Copy link

When elm-app start fails to compile, you'll get a list of warnings and errors, but when it succeeds, the warnings does not show.

It would be helpful to show the warnings along with the "compiled successfully" screen, as they often contain some useful information.

@halfzebra halfzebra added the bug A bug-report label Sep 26, 2016
@jackfranklin
Copy link
Contributor

@halfzebra if you have not started work on this I'd love to take a stab at it? :)

@halfzebra
Copy link
Owner

@jackfranklin That would be awesome!

As of today #36, #38 are in my pipeline for the next release.

@jackfranklin
Copy link
Contributor

@halfzebra so I took a look at this and I think there might be a bug in the elm-webpack-loader. It doesn't ever seem to pass the warnings through - so in the script where we call stats.hasWarnings(), it's always false, and the warnings is an empty array, even when there were warnings logged to the console.

@halfzebra halfzebra removed the bug A bug-report label Jun 28, 2017
@jdashton
Copy link

I wonder if there's a different approach that would avoid the need for the hasWarnings call. Specifically, if you use a non-destructive screen clear, instead of totally wiping the screen buffer, then users would have the option of scrolling up to go back and see the results of the compilation, including any warnings or other informational messages.

@halfzebra
Copy link
Owner

@jdashton the thing is that node-elm-compiler will only print out warnings, when there's a compilation error. There's no way of retrieving the warnings without changing the way node compiler works.

@halfzebra halfzebra reopened this Jul 31, 2017
@jdashton
Copy link

My confusion would be that I think that I see warnings scroll past in that window, even in the no-error case. However, the web server clears the window in a way that prevents scrolling back to check what I have just seen. I apologize if I'm misinterpreting what I'm seeing.

@andys8
Copy link
Contributor

andys8 commented Aug 9, 2017

@halfzebra If it's missing in the node-elm-compiler, we should request this feature. Here is the where the flag is passed: https://github.com/rtfeldman/node-elm-compiler/blob/d1a27f4ccc4537a243725875f511af285c209e61/index.js#L174

If @jdashton is right, it would be because of the react-dev-utils::clearConsole(), right? I didn't verify it, but I certainly have it in mind like he describes it.

@tkgalk
Copy link

tkgalk commented Nov 14, 2017

Yeah, I can confirm that I can see what @jdashton is describing. I have a simple application where this is happening (both before and after ejecting). Here is a short video, even though the browser popped out I managed to catch before it got cleared. You can pause at 0:06 to see it clearly.

https://monosnap.com/file/uEgcw5Pb7gln7VknabN5gHRy4ROG3Y#

@dcecile
Copy link
Contributor

dcecile commented Feb 13, 2018

I'm just getting started with Elm (using the Webpack setup from Create Elm App), and I can't figure out a good way to see warnings for all the Elm files in my project.

  • Using elm-app start I only get a flash of warning text (i.e. this issue here)
  • Using elm-app make --warn has the side effect of generating an index.html file (not needed for a Webpack build), and it seems to have some caching features which interfere with a full report
  • From what I see, there's no way to configure warnings as errors yet

Any suggested workarounds for now?

@dcecile
Copy link
Contributor

dcecile commented Feb 15, 2018

(FWIW, this is the crude script that I'm currently using as a workaround) 👇

rm -rf elm-stuff/build-artifacts/0.18.0/MYPROJECT && elm-make src/Main.elm --warn --output /dev/null

@halfzebra
Copy link
Owner

The problem with this issue is that the loader does not send the warnings in the way intended by the Webpack's API. The warnings are piped into stdout directly from the compiler.

There are two options:

  • Change the way the node distribution of compiler sends the warnings and pass them to the loader
    Related to rtfeldman/node-elm-compiler/issues/66
  • Revisit the logic, that clears out the stdout in Create Elm App

I'll see what I can do with the second option for now 🤔

@halfzebra
Copy link
Owner

Closing this due to elm-community/elm-webpack-loader#141 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants