Closed kristianmandrup closed 9 years ago
Hi @kristianmandrup, the culprit is that your application is going into an infinite restart because your ignore rules aren't quite right. The following file is being modified during startup and that is triggering a restart before the app is ready:
[browser-refresh] File has been changed: apps/index/page/index.marko.js
[browser-refresh] Restarting app...
[browser-refresh] App started (pid: 47279)
[browser-refresh] File has been changed: apps/index/page/index.marko.js
[browser-refresh] Restarting app...
[browser-refresh] App started (pid: 47280)
By default, browser-refresh
will ignore any files listed in your .gitignore
. Either that is not working properly or you are missing *.marko.js
in your .gitignore
. I find it helpful to use a separate .browser-refresh-ignore
file for browser-refresh
. For example:
.browser-refresh-ignore
/node_modules
/.cache
/build
*.marko.js
This files should be in the root of the project. For example: marko-js-samples/marko-widgets-lasso/.browser-refresh-ignore
Finally, we recently pushed a new version of browser-refresh
(and some of its dependencies) because we needed to upgrade to the latest version of chokidar
and that introduced some issues along the way. I am pretty sure we have all of the issues sorted out, but I recommend installing the latest:
npm install browser-refresh --global
Hope that solves your problem!
I'll have to checkout out jade-marko
this morning. Thanks for sharing and thanks for contributing!
Hi guys,
Thanks for all your great work! I'm really excited trying to get this browser refresh to work. My marko hot reload works perfectly, so this is my last step for true mastery :)
Here is my main .marko index page with
<browser-refresh enabled="true" />
at the end of body.And my server config:
This is what I get when I start my server using
browser-refresh
Timed out :(
The browser is not automatically started on the index page at
localhost:4005
(should it?). If I try to go there directly, it simply reverts to the previous page. It can't seem to load the real server, doing some kind of back history jump instead. Any ideas? I expect it would work similar to BrowserSync but I was unable to make that work as well... might try again now that marko hot reload works however... :P But I'd rather get your awesome browser refresh solution working. I know I'm SO close, just one obvious thing I'm missing or misunderstanding I'm sure :)Thanks as always guys :) Cheers!!! Kristian
PS: I created a jade-marko Gulp transformer for you ;)
https://github.com/kristianmandrup/jade-marko