Auto-regeneration doesn't work even when enabled

Just then, I was running smoothly using the jekyll serve command, auto-generation worked well and I was able to see changes immediately after I did some modification locally. But all of a sudden auto-generation stops working even when it is said to be “enabled for ‘(my working directory)’”.

I don’t have the plugin as this post mentions. And I’m able to see changes again only after I use jekyll serve --force_polling.

I’m running on macOS and jekyll version 4.0.0.

Is there any way to only use jekyll serve command again?

Maybe it was just your terminal getting hanged.
Try stopping the local server and re-serving. If it still doesn’t regenerate, try serving your site with the
--verbose switch. That may provide a clue as to where the build stalls.

Hi, thanks for your advice. However, even after I stop the local server and re-serve, it still doesn’t regenerate. After adding --verbose onto the command, it shows:

[(time)] INFO  WEBrick 1.4.2
[(time)] INFO  ruby 2.6.3 (2019-04-16) [universal.x86_64-darwin19]
[(time)] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[(time)] DEBUG unmount .
[(time)] DEBUG Jekyll::Commands::Serve::Servlet is mounted on .
    Server address: http://127.0.0.1:4000
[(time)] INFO  WEBrick::HTTPServer#start: pid=20287 port=4000
    Server running... press ctrl-c to stop.

which still leaves me no clues about what is going on.

[Updates]
Auto-generation doesn’t work using jekyll serve command still after restarting my laptop.

Is your site source somewhere public that I could take a look / clone locally?

@ashmaroli Isn’t the --livereload flag the recommended way to do autogeneration?

e.g.
bundle exec jekyll serve --livereload

Docs

@ckruse --livereload autorefreshes your browser window.
Autoregeneration however is about triggering a build process automatically after one of your source file gets changed.

Autoregen is enabled by default when you run jekyll serve.
To enable it with jekyll build, you would need to pass it the --watch switch. i.e. run
jekyll build --watch.

Livereload cannot be enabled with build subcommand…

2 Likes

No, --livereload doesn’t help in this case since it only reloads the page on your browser and not building it beforehand.

Hi all,

I think I will just run the jekyll serve --force_polling command for now before I get into any trouble again. It works well so far with the --force_polling flag.

Thank you again for all the advices.