brunch / auto-reload-brunch

Adds automatic browser reloading support to brunch.
88 stars 30 forks source link

Chrome/Firefox doesn't auto refresh on update #50

Closed 1951FDG closed 9 years ago

1951FDG commented 9 years ago

Unfortunately, I don't get have any debug info.

Currently using: auto-reload-brunch 1.7.4 brunch 1.7.17 npm 2.0.0-alpha-5

es128 commented 9 years ago

Unfortunately, there is no way to help with so little information provided.

Brunch output? Browser console messages?

1951FDG commented 9 years ago

Browser displays no console message. Brunch displays the usual compile messages after a file change is saved.

es128 commented 9 years ago

Are you running brunch w -s? Are you using brunch's built in server or a custom one? What is the output of brunch w -sd?

1951FDG commented 9 years ago

I am running brunch watch -s. I am using the built in server.

Output of brunch w -sd:

06 Oct 19:54:14 - info: compiled 32 files into 5 files, copied 30 in 15131ms brunch:pipeline Reading 'app/styles/site.css' +1.4m brunch:watch File 'app/styles/site.css' received event 'change' +1.5m brunch:pipeline Linting 'app/styles/site.css' +9ms brunch:pipeline Compiling 'app/styles/site.css' with 'AutoprefixerCompiler' +1ms brunch:pipeline Compiling 'app/styles/site.css' with 'CSSCompiler' +1ms brunch:pipeline Compiling 'app/styles/site.css' with 'CsscombCompiler' +1ms brunch:source-file Generated source map for 'app/styles/site.css': "{\"version\":3,\"sources\":[],\"names\":[],\"mappings\":\"\",\"file\":\"to.css\"}" +1.4m brunch:file-list Compiled file 'app/styles/site.css'... +1.4m brunch:generate Concatenating app/styles/app.css, app/styles/site.css to public/stylesheets/app.css +1.4m brunch:common Writing file 'public/stylesheets/app.css' +1.4m brunch:common Writing file 'public/stylesheets/app.css.map' +9ms 06 Oct 19:55:34 - info: compiled site.css and 1 cached file into app.css in 120ms

es128 commented 9 years ago

I'd be more interested in the part of the debug output you decided not to provide.

Try this to confirm the auto-reload script is being included in your built files: brunch w -sd 2>&1 | grep auto-reload

Is auto-reload-brunch listed in your package.json?

1951FDG commented 9 years ago

Mon, 06 Oct 2014 18:42:49 GMT brunch:source-file Initializing fs_utils.SourceFile: {"path":"node_modules/auto-reload-brunch/vendor/auto-reload.js","isntModule":true,"isWrapped":true} Mon, 06 Oct 2014 18:42:49 GMT brunch:pipeline Reading 'node_modules/auto-reload-brunch/vendor/auto-reload.js' Mon, 06 Oct 2014 18:42:49 GMT brunch:pipeline Linting 'node_modules/auto-reload-brunch/vendor/auto-reload.js' Mon, 06 Oct 2014 18:42:49 GMT brunch:pipeline Compiling 'node_modules/auto-reload-brunch/vendor/auto-reload.js' with 'AutoReloader' Mon, 06 Oct 2014 18:42:49 GMT brunch:pipeline Compiling 'node_modules/auto-reload-brunch/vendor/auto-reload.js' with 'JavaScriptCompiler' Mon, 06 Oct 2014 18:42:49 GMT brunch:file-list Compiled file 'node_modules/auto-reload-brunch/vendor/auto-reload.js'...

Yes, auto-reload-brunch is listed in my package.json.

es128 commented 9 years ago

Which of your dest files is auto-reload.js being joined to, and is that file included in your pages?

es128 commented 9 years ago

auto-reload.js is not being concatenated anywhere. Try setting files.javascripts.pluginHelpers to app.js

The automatic resolution of pluginHelpers to the first javascript joinTo apparently is not working in your case. Could you possibly provide your entire config to help with debugging that?

es128 commented 9 years ago

That's odd, since it doesn't seem a vendor.js ever gets written. I suppose you have nothing in your ./vendor directory? Removing the 'javascripts/vendor.js': /^vendor/ line in your config may also fix this for you, causing the auto-reload.js to get concatenated into your app.js.

Still, it would appear to be a bug in brunch core, that the plugin helpers don't get written anywhere if the target file has no other source files going into it.

1951FDG commented 9 years ago

Indeed, my ./vendor directory does not contain any files, only empty sub directories. Removing the 'javascripts/vendor.js': /^vendor/ line in my config fixes the issue.

1951FDG commented 9 years ago

Thanks for your help solving this issue

bkuri commented 9 years ago

Sorry, but I'm having the exact same issue as @1951FDG, except that I have no vendor folder to begin with, although I do have a bower_components folder (FWIW). I have checked all of the above and the file is definitely being loaded. Everything is as it should config-wise, but it simply doesn't autoreload, no matter what I try.

You can clone my repo if you want to try it out for yourself: https://github.com/bkuri/rightfoot-nodejs (it's actually quite light as far as actual code goes, so it should be easy to spot something weird).

Any help would be appreciated. TIA!

bkuri commented 9 years ago

Turns out the same code works perfectly on one PC and doesn't work in the other. Don't ask me why...