vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.54k stars 4.76k forks source link

Updating config.js or YAML Frontmatter don't trigger Hot Reload #2437

Open tecnoloco opened 4 years ago

tecnoloco commented 4 years ago

Bug report

Updating config.js or YAML Frontmatter don't trigger Hot Reload.

Steps to reproduce

Change values inside config.js or in YAML Frontmatter in .md files.

What is expected?

Hot reload with the changes applied.

What is actually happening?

Hot reload is not happening, changes are not being rendered.

Other relevant information

Environment Info:

System: OS: Windows 10 10.0.19041 CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz Binaries: Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 2.0.0-rc.27 - C:\Program Files\nodejs\yarn.CMD npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.19041.1.0 npmPackages: @vuepress/core: 1.5.1 @vuepress/theme-default: 1.5.1 vuepress: 1.5.1 => 1.5.1 npmGlobalPackages: vuepress: Not Found

thominal commented 4 years ago

+1 Same issue on my side.

adamdehaven commented 4 years ago

Same here. For reference, here's the error I receive when updating the config.js file:

error @vuepress/plugin-blog apply clientDynamicModules failed.
(node:18288) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'reduce' of undefined
    at clientDynamicModules (D:\adam\Development\vuepress\node_modules\@vuepress\plugin-blog\lib\node\index.js:91:81)
    at ClientDynamicModulesOption.asyncApply (D:\adam\Development\vuepress\node_modules\@vuepress\core\lib\node\plugin-api\abstract\AsyncOption.js:33:21)
    at async ClientDynamicModulesOption.apply (D:\adam\Development\vuepress\node_modules\@vuepress\core\lib\node\plugin-api\override\ClientDynamicModulesOption.js:15:5)
    at async PluginAPI.applyAsyncOption (D:\adam\Development\vuepress\node_modules\@vuepress\core\lib\node\plugin-api\index.js:277:5)
    at async Promise.all (index 0)
    at async App.process (D:\adam\Development\vuepress\node_modules\@vuepress\core\lib\node\App.js:124:5)
(node:18288) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:18288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
zhaokgithub commented 4 years ago

Same here on my side.

bwyx commented 4 years ago

upgrade to node 14.x fixed this issue for me.

coffeephile commented 4 years ago

I tried updating to Node 14.x on Windows 10, but still no luck.

Light hot reload (markdown hot reload) works fine, but deep hot reload (config.js changes, frontmatter changes) gets stuck on the terminal and I don't see the updates on the site.

No issues on Mac though.

surjithctly commented 4 years ago

+1

Following up on this. Have same issue.

SimZhou commented 4 years ago

Same here.

update1: Tried upgrading node from v10 to v12, still.

update2: watchpack v1.6.1, v1.7.2, both not working.

update3: Changed my directories by removing special characters (my project dir has dots and spaces), still.

update4: tried vuepress v1.5.1, 1.5.2, still.

SimZhou commented 4 years ago

update5: I got it Solved!

By running the local server with option --temp .temp!

Specifically, in package.json, substitute:

"dev": "vuepress dev docs",   

with

"dev": "vuepress dev docs --temp .temp",   

This creates you a temporary folder ".temp" for your dev server. If you don't want this to be pushed to your remote repo, just add this folder name in your .gitignore file.

It works for me, not sure if it works for you as well.

surjithctly commented 4 years ago

@SimZhou Not working for me. Tried your ``temp fix but after reloading, it goes blank.

aceven24 commented 4 years ago

Might have posted to wrong issue, but I have issues with frontmatter not hotloading..

Environment Info:

System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel(R) Core(TM) i5-1035G7 CPU @ 1.20GHz Binaries: Node: 12.13.1 - ~\AppData\Local\Temp\yarn--1593533765469-0.49432315341001365\node.CMD Yarn: 1.21.1 - ~\AppData\Local\Temp\yarn--1593533765469-0.49432315341001365\yarn.CMD npm: 6.12.1 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.18362.449.0 npmPackages: @vuepress/core: 1.5.2 @vuepress/theme-default: 1.5.2 vuepress: ^1.5.2 => 1.5.2 npmGlobalPackages: vuepress: Not Found

aceven24 commented 4 years ago

Anyone got ideas on this?

surjithctly commented 4 years ago

@aceven24 Its not fixed yet. See another Open issue from 2019 #1283

sdwru commented 4 years ago

@SimZhou Not working for me. Tried your ``temp fix but after reloading, it goes blank.

Not working for me either. I've tried all the fixes. None of them work. I think there may be more than one issue that are only loosely related.

SimZhou commented 4 years ago

Evan You is now working on Vitepress, which is a new version of vuepress, along with vue 3.0...It uses vite to handle hot reloading now, instead of webpack. (In a recent interview Evan also said his initiative to build vite was originally for a better vuepress experience, I don't know if it includes this bug)

Anyway...I think soon this bug would no longer be important...since vite would be way faster than webpack.

check this: vuejs/vitepress#motivation