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

enableBuildNotifications --watch #362

Closed
hugoalexmartins opened this issue Jul 26, 2018 · 12 comments
Closed

enableBuildNotifications --watch #362

hugoalexmartins opened this issue Jul 26, 2018 · 12 comments

Comments

@hugoalexmartins
Copy link

hugoalexmartins commented Jul 26, 2018

Hi guys,

I just have started in webpack encore right now.

I have this on my webpack.config.js

var Encore = require('@symfony/webpack-encore');

Encore
// the project directory where all compiled assets will be stored
.setOutputPath('public/build/')

// the public path used by the web server to access the previous directory
.setPublicPath('/build')

// will create web/build/cve_app.js
.addEntry('cve_app', './public/assets/js/cveApp.js')

.enableBuildNotifications();

;

// export the final configuration
module.exports = Encore.getWebpackConfig();

But I just receive the notification when the first build finished, when I use --watch the notification doesn't show up..

Anyone knows whats happening ?
Thanks in advance.

@Lyrkan
Copy link
Collaborator

Lyrkan commented Jul 26, 2018

Hi @hugoalexmartins,

Could you try enabling the alwaysNotify option of the webpack-notifier plugin?

Encore.enableBuildNotifications(true, (options) => {
    options.alwaysNotify = true;
});

@hugoalexmartins
Copy link
Author

Hi @Lyrkan

Yes it works !

Any reason for this procedure ? I am doing anything wrong ?

@Lyrkan
Copy link
Collaborator

Lyrkan commented Jul 26, 2018

Nothing wrong, that's just how the plugin works :)

@stof
Copy link
Member

stof commented Jul 26, 2018

that's a choice they made explicitly. By default, they notify only for failures, and for the first passing build after that: https://github.com/Turbo87/webpack-notifier#webpack-notifier

@hugoalexmartins
Copy link
Author

Thanks you very much !

@hugoalexmartins
Copy link
Author

Hey,

My mac osx gets sleep about 5min, and now the notifications aren't show up in any time...

This is weird...

@hugoalexmartins
Copy link
Author

hugoalexmartins commented Jul 26, 2018

this is my config:

var Encore = require('@symfony/webpack-encore');

Encore
    // the project directory where all compiled assets will be stored
    .setOutputPath('public/build/')

    // the public path used by the web server to access the previous directory
    .setPublicPath('/build')

    // will create web/build/cve_app.js
    .addEntry('cve_app', './public/assets/js/cveApp.js')
    
    //.enableBuildNotifications();

;

Encore.enableBuildNotifications(true, (options) => {
    options.alwaysNotify = true;
});

// export the final configuration
module.exports = Encore.getWebpackConfig();

@Lyrkan
Copy link
Collaborator

Lyrkan commented Jul 26, 2018

I don't have a mac to test it but that's probably not related to Encore since we are simply adding the webpack-notifier plugin to the Webpack config.

It could be an issue with the plugin itself or with node-notifier...

@hugoalexmartins
Copy link
Author

This is weird.

Do you think I can anything to debug and see what's happening ?

@Lyrkan
Copy link
Collaborator

Lyrkan commented Jul 27, 2018

I'm not sure what to check...

Is it only the notifications part that doesn't work? Or does Webpack also stop recompiling your files?
Do the notifications start to work again after restarting Encore?

@hugoalexmartins
Copy link
Author

It is only the notifications part that doesn't work now.
The compilations and recompilations are working fine.
The notifications doesn't work after restart Encore.

Do you think it could be any issue with Macosx ?

@Kocal
Copy link
Member

Kocal commented Jan 25, 2025

Hi, I don't know if this issue is still happening 7 years later, but if it's the case, it sureley an issue from macOS or from webpack-notifier dependency.

Side node, we recently agreed to remove the webpack-notifier dependency and Encore.enableBuildNotifications() from the Symfony recipe, see symfony/recipes#1353

@Kocal Kocal closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2025
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

4 participants