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

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

Open
tecnoloco opened this issue Jun 9, 2020 · 14 comments
Open

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

tecnoloco opened this issue Jun 9, 2020 · 14 comments
Labels
type: bug Something isn't working

Comments

@tecnoloco
Copy link

tecnoloco commented Jun 9, 2020

  • [ x] I confirm that this is an issue rather than a question.

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

@bencodezen bencodezen added the type: bug Something isn't working label Jun 10, 2020
@thominal
Copy link

+1 Same issue on my side.

@adamdehaven
Copy link
Contributor

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
Copy link

zhaokgithub commented Jun 18, 2020

Same here on my side.

@bwyx
Copy link

bwyx commented Jun 21, 2020

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

@coffeephile
Copy link

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
Copy link

+1

Following up on this. Have same issue.

@SimZhou
Copy link

SimZhou commented Jun 30, 2020

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
Copy link

SimZhou commented Jun 30, 2020

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
Copy link

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

@aceven24
Copy link

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
Copy link

aceven24 commented Jul 9, 2020

Anyone got ideas on this?

@surjithctly
Copy link

surjithctly commented Jul 17, 2020

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

@sdwru
Copy link

sdwru commented Jul 17, 2020

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

SimZhou commented Jul 17, 2020

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

spinda added a commit to spinda/vuepress that referenced this issue Aug 11, 2020
Calling emptyDirSync every time createTemp is called - i.e, every time
App.process is called; i.e., every time source files update - throws off
webpack-dev-server, causing it to lose track of the source files and
subdirectories. This leads to a variety of sporadic errors and breaks
auto-refresh of frontmatter and configuration. Fix this by avoiding
emptying temporary directories when we can detect that they were
previously initialized by the same instance of the VuePress process.

Fixes vuejs#1283.
Fixes vuejs#2233.
Fixes vuejs#2254.
Fixes vuejs#2437.
spinda added a commit to spinda/vuepress that referenced this issue Aug 11, 2020
Calling emptyDirSync every time createTemp is called - i.e, every time
App.process is called; i.e., every time source files update - throws off
webpack-dev-server, causing it to lose track of the source files and
subdirectories. This leads to a variety of sporadic errors and breaks
auto-refresh of frontmatter and configuration. Fix this by avoiding
emptying temporary directories when we can detect that they were
previously initialized by the same instance of the VuePress process.

Fixes vuejs#1283.
Fixes vuejs#2233.
Fixes vuejs#2254.
Fixes vuejs#2437.
spinda added a commit to spinda/vuepress that referenced this issue Aug 11, 2020
Calling emptyDirSync every time createTemp is called - i.e, every time
App.process is called; i.e., every time source files update - throws off
webpack-dev-server, causing it to lose track of the source files and
subdirectories. This leads to a variety of sporadic errors and breaks
auto-refresh of frontmatter and configuration. Fix this by avoiding
emptying temporary directories when we can detect that they were
previously initialized by the same instance of the VuePress process.

Fixes vuejs#1283.
Fixes vuejs#2233.
Fixes vuejs#2254.
Fixes vuejs#2437.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests