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

Automatic Reload not working? #221

Closed
luisDanielRoviraContreras opened this issue Apr 23, 2018 · 27 comments
Closed

Automatic Reload not working? #221

luisDanielRoviraContreras opened this issue Apr 23, 2018 · 27 comments

Comments

@luisDanielRoviraContreras
Copy link
Contributor

luisDanielRoviraContreras commented Apr 23, 2018

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
@ulivz
Copy link
Member

ulivz commented Apr 23, 2018

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

@yyx990803
Copy link
Member

Also try vuepress dev --host localhost

@luisDanielRoviraContreras
Copy link
Contributor Author

This is what it shows me when executing and what's below when making the changes but it does not automatically recharge anyway

 $ vuepress dev
 Extracting site metadata...[11:48:27] Compiling Client
 [11:48:30] Compiled Client in 3s

 VuePress dev server listening at http://localhost:8080/

 [11:49:09] Compiling Client
 [11:49:10] Compiled Client in 246ms
 [11:49:10] ✔ successfully compiled.
 [11:49:21] Compiling Client
 [11:49:22] Compiled Client in 204ms
 [11:49:22] ✔ successfully compiled.
 [11:49:22] Compiling Client
 [11:49:22] Compiled Client in 157ms
 [11:49:22] ✔ successfully compiled.
 [11:58:39] Compiling Client
 [11:58:39] Compiled Client in 203ms
 [11:58:39] ✔ successfully compiled.
 [11:58:39] Compiling Client
 [11:58:40] Compiled Client in 204ms
 [11:58:40] ✔ successfully compiled.
 [11:59:02] Compiling Client
 [11:59:02] Compiled Client in 174ms
 [11:59:02] ✔ successfully compiled.
 [11:59:02] Compiling Client
 [11:59:02] Compiled Client in 168ms
 [11:59:02] ✔ successfully compiled.
 [11:59:31] Compiling Client
 [11:59:31] Compiled Client in 218ms
 [11:59:31] ✔ successfully compiled.
 [11:59:31] Compiling Client
 [11:59:32] Compiled Client in 152ms
 [11:59:32] ✔ successfully compiled.
 [12:03:39] Compiling Client
 [12:03:40] Compiled Client in 192ms
 [12:03:40] ✔ successfully compiled.

@ulivz
Copy link
Member

ulivz commented Apr 23, 2018

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

@ulivz
Copy link
Member

ulivz commented Apr 23, 2018

Looked same to #123

@luisDanielRoviraContreras
Copy link
Contributor Author

luisDanielRoviraContreras commented Apr 23, 2018

@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

@yyx990803
Copy link
Member

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

@cesarga
Copy link

cesarga commented May 4, 2018

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: webpack-contrib/webpack-serve#56 (comment)

@incrypto32
Copy link

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

@sabicalija
Copy link

sabicalija commented May 19, 2020

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.

@dcodeIO
Copy link

dcodeIO commented May 20, 2020

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

@incrypto32
Copy link

I think this issue needs to be reopened
Is this a bug in Vue Press or is it in webpack?
Because when I look in the console I see an error message saying WDS disconnected.

@sabicalija
Copy link

sabicalija commented May 21, 2020

I managed to get it working by reusing an older lockfile. Hope it helps.

But I've tested it with 1.4.1 and 1.5.0 as well, using new and simple setups (Linux). Reloading did not work as with the previous versions. Have you experienced the same?

@sktzofrenic
Copy link

I'm experiencing this issue as well.

@venimus
Copy link

venimus commented May 21, 2020

Similar regression for me when updated from 1.4.1 to 1.5.0. Env is WSL

@acmoles
Copy link

acmoles commented May 22, 2020

I'm facing this issue after updating from 1.4.1 to 1.5.0, but on MacOS

Edit: returning to 1.4.1 does not solve the issue - I expect this is a problem with Webpack

@fmonper1
Copy link

Can confirm hot reloading doesn't work after updating from 1.4.x to 1.5. It doens't work after rolling back either

@faroit
Copy link

faroit commented May 24, 2020

doesn't work here as well (OSX, 1.5)

@thomrad
Copy link

thomrad commented May 25, 2020

same problem. (Windows 10) node, npm, yarn, vuepress fresh installs.

@ansky-pro
Copy link

ansky-pro commented May 25, 2020

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

@incrypto32
Copy link

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?

@paulvanbladel
Copy link

paulvanbladel commented May 27, 2020

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.

@tcrapts
Copy link

tcrapts commented May 28, 2020

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.

ubugnu added a commit to ionoid/docs.ionoid.io that referenced this issue Jun 2, 2020
@sktzofrenic
Copy link

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.

@kevinpainchaud
Copy link

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.

Works for me! Thx! 🎉

@ClintOxx
Copy link

ClintOxx commented Jul 20, 2021

Having this issue and the suggestions haven't fixed it for me, unfortunately. Didn't realize how annoying the lack of hot reload could be

this fixed it for me
https://stackoverflow.com/a/39746894/3349527

The issue is probably from me restructuring the root and doc folder

@SwatDoge
Copy link

SwatDoge commented Oct 14, 2021

Non of the above solutions fixed my issue, switched to linux, worked like a dream.

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