vuepress: Automatic Reload not working?

You can have an automatic reload to be on the development server, for every change I have to reload the page manually

So you can compile the directory directly in C: \ vuepress-dev

The command vuepress dev already works but when I make some change in the README.md it does not update automatically

  • Your OS: Window
  • Node.js version: v8.4.0
  • VuePress version: v0.7.0
  • Browser version: Google Chrome Versión 65.0.3325.181 (Build oficial) (64 bits)
  • Is this a global or local install?: Global
  • Which package manager did you use for the install?: NPM

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 27 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I got it working by downgrading dependency watchpack to 1.6.1 Added resolutions section to package.json and ran yarn install

  "resolutions": {
    "watchpack": "1.6.1"
  }

Hope this helps to anyone struggling with the same problem #2392

Also try vuepress dev --host localhost

I am having this issue. Vuepress does not hot reload when I make changes. I used yarn to install vuepress and also tries vuepress dev --host localhost. But it did’nt help

I’m experiencing the same. File changes in markdown files can be detected when I change the configuration to the default (cf. extraWatchFiles).

module.exports = {
   ...,
   extraWatchFiles: ["**/*.md", "**/*.vue"],
   ...
}

However, automatic (or manual) reloading does work. I have to stop and restart the dev server every time.

I am having this issue. Vuepress does not hot reload when I make changes. I used yarn to install vuepress and also tries vupress dev --host localhost. But it did’nt help

Same problem for me. With the extraWatchFiles above plus --host localhost, the server does some building upon changing an .md file, but it doesn’t update in the browser. Interestingly, if I change a headline, it will update in the sidebar, but the page remains the same. Reloading the page also doesn’t help and I have to restart the vuepress dev process. v1.5.0, Windows

Looks like wepback-serve doesn’t like 0.0.0.0 on Windows. We might need to default to localhost on Windows.

I got it working by downgrading dependency watchpack to 1.6.1 Added resolutions section to package.json and ran yarn install

  "resolutions": {
    "watchpack": "1.6.1"
  }

Hope this helps to anyone struggling with the same problem #2392

This works! For clarity, if you use npm, you must also npm-force-resolutions.

To summarize and clarify, you need to add two things to package.json if you use npm.

"scripts": {
  "preinstall": "npx npm-force-resolutions"
}

and

  "resolutions": {
    "watchpack": "1.6.1"
  }

Followed by npm install.

Result: after updating a *.md file, you don’t need to hit refresh in the browser or restart Vuepress to see the changes.

I got it working by downgrading dependency watchpack to 1.6.1 Added resolutions section to package.json and ran yarn install

  "resolutions": {
    "watchpack": "1.6.1"
  }

Hope this helps to anyone struggling with the same problem #2392

@ansky-pro so is it an issue with webpack or vuepress its a bug right? @yyx990803 whould this issue be reopened?

What worked, as a workaround, for me is adding additional nodemon script in package.json

"start": "nodemon --ext md,vue --watch .vuepress --watch . --exec vuepress dev docs --host localhost"

First install nodemon globally (npm install -g nodemon). Afterwards you can do: npm run start.

@yyx990803 Ready already worked when running vuepress dev --host localhost thank you very much and apologize for the inconvenience because running it that way if it works what is the difference

Have you tried vuepress dev --host localhost as Evan said?

I got it working by downgrading dependency watchpack to 1.6.1 Added resolutions section to package.json and ran yarn install

  "resolutions": {
    "watchpack": "1.6.1"
  }

Hope this helps to anyone struggling with the same problem #2392

This works! For clarity, if you use npm, you must also npm-force-resolutions.

To summarize and clarify, you need to add two things to package.json if you use npm.

"scripts": {
  "preinstall": "npx npm-force-resolutions"
}

and

  "resolutions": {
    "watchpack": "1.6.1"
  }

Followed by npm install.

Result: after updating a *.md file, you don’t need to hit refresh in the browser or restart Vuepress to see the changes.

I attempted this, but it did not work in my case unfortunately.

If you are on Windows, but you are running VuePress on a Linux Docker container, this problem still exists because process.platform is still ‘linux’.

I think this would be a better solution: https://github.com/webpack-contrib/webpack-serve/issues/56#issuecomment-377912611

Can you open the console and see whether there is some error? such as WebSocket connection to 'ws://0.0.0.0:8081/' failed?