-
Notifications
You must be signed in to change notification settings - Fork 41
webpack doesn't always report compilation errors with --watch #66
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
Comments
Thanks for the report. I will take a look. What version of purescript, purs-loader, webpack, etc., are you using? |
Sorry, I should have included that before:
along with a local clone of psa with the PureScript 0.9.x changes. I see the same behavior with plain psc though. |
Great! Thanks for the info. On Thursday, 18 August 2016, Peter Brant [email protected] wrote:
|
Resolved inadvertently in b683b0b Should be fixed in 2.1.1. Let me know if this is still an issue. |
I think this might still be a problem. Here is what I tried: Starting with a fresh clone of purescript-webpack-example:
|
Thanks for confirming and for the test case. I will give it a try.
…On Wed, Nov 23, 2016 at 19:00 Peter Brant ***@***.***> wrote:
I think this might still be a problem. Here is what I tried:
Starting with a fresh clone of purescript-webpack-example:
- After installing, ran npm run webpack:watch, compilation finishes
successfully
- Edited src/example/Header.purs to add a second copy of the header
function named header2
- Changed DOM.text to DOM.textXX in both functions
- Rewarded with ERROR in [1/2 UnknownName]
src/Example/Header.purs:12:18 and [2/2 UnknownName]
src/Example/Header.purs:18:18
- Fixed one of the two functions, but nothing happened
- Fixed the second one, bundle is created
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVYy9DMmuqCM3NjM2gd4swMOWN1BGh5ks5rBNOagaJpZM4Jn9-c>
.
|
Similar to the way psc-ide support works, the purs-loader now tolerates compiler errors when the `watch` option is true. When webpack is being run in watch mode the user can set `watch` to true in order to avoid failing the webpack bundle creation when the PureScript compiler fails. Resolves issue #66 Resolves issue #73 Resolves issue #74
I've published a beta release that should fix this issue. If you are willing to give it a try, that would be great! You can install the release under the
In this release, there is a new option called Thanks! |
Is there a particular version of webpack I should be using? For me with the beta version of purs-loader, webpack 1.14.0 and I've included the console output below with DEBUG=purs-loader (with a bit of additional logging added). This is a successful initial compilation, breaking Header.purs in two places (as above), and then fixing both.
|
My mistake. There was a typo which caused the bundle not to be generated. Please update to Thanks! |
No joy, I'm afraid. For what it's worth, purescript-webpack-example uses
bundle: false so the fix there might not have helped.
…On Mon, Feb 20, 2017 at 7:05 PM, eric ***@***.***> wrote:
My mistake. There was a typo which caused the bundle not to be generated.
Please update to 2.4.0-beta.1 if you have a chance and give it a go.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABeaI5LYWAh63qO1XfFRP_Od6ojwRCMks5redYDgaJpZM4Jn9-c>
.
|
Thanks for giving this another try. I am testing using webpack 1.13, but 1.14 I suspect should also work. In the output above, it looks like webpack is does produce a bundle:
Which npm script are you using? Also, just to make sure that I follow the test-case. Is it that when you break the Header.purs, webpack is not recompiling at all or is webpack rebuilding but no purescript error is reported? Thanks! |
Quick update: I was just able to reproduce your issue. It seems that with just webpack watch we get this issue, but with the webpack dev server, things seem to work as expected. Let me take a look. |
Thanks much. I was indeed using `DEBUG=purs-loader npm run webpack:watch`.
…On Mon, Feb 20, 2017 at 8:15 PM, eric ***@***.***> wrote:
Quick update: I was just able to reproduce your issue. It seems that with
just webpack watch we get this issue, but with the webpack dev server,
things seem to work as expected. Let me take a look.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABeaDTpn2E5N7yDFrnobDGMsDIRMSjhks5reeZmgaJpZM4Jn9-c>
.
|
Welcome. Thanks for testing this out. I will have to investigate this further. It seems the compilation error is being reported to webpack, but is not displayed. If I add the following plugin to the webpack.config.js, then the error is displayed: plugins: [
function() {
this.plugin('done', function(stats){
if (stats.compilation.errors && stats.compilation.errors.length) {
stats.compilation.errors.forEach(function(error){
process.stderr.write(error);
});
}
});
}
] |
Simplified this a little bit: plugins: [
function(){
this.plugin('done', function(stats){
process.stderr.write(stats.toString('errors-only'));
});
}
] If you add the above to report the compilation error, does the beta version fix this issue for you? As a note, the bundle will not be modified if you are fixing type-related errors. It is produced if text changes, for example. |
If adding the plugin to report the error does work for you, I may track this as a limitation and consider this issue resolved. |
Sounds good to me. I can confirm that adding the snippet above to
webpack.config.js fixes the problem. Thanks very much for slogging through
this (and enabling me to continue in my blissful ignorance of webpack
internals!).
…On Mon, Feb 20, 2017 at 9:00 PM, eric ***@***.***> wrote:
If adding the plugin to report the error does work for you, I may track
this as a limitation and consider this issue resolved.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABeaGdyUq9fjSt9Yj5ty8nPvbesph1Gks5refDBgaJpZM4Jn9-c>
.
|
Thanks for confirming! I've added a note about this plugin in the readme. Thanks again for your help. |
Steps to reproduce:
At this point, a new error will be reported (i.e. steps 2 through 4 can be repeated indefinitely).
I've done a bit of snooping around, but I'm not sure what the appropriate fix is. The
after-compile
plugin callback is called andcache.errors
is populated, but just adding it tocompilation.errors
apparently isn't enough to tell webpack to display it.The text was updated successfully, but these errors were encountered: