reload infinitely when use soft link of node_modules for local serve
crifan opened this issue · comments
Crifan Li commented
Summary
local debug:
npx honkit serve
- using normal
node_modules
: OK - using soft link
node_modules
: infinite reload- soft link
node_modules
created byln -s ../../generated/honkit/node_modules node_modules
- soft link
- HonKit version:
8.5.2
- node version:
v17.7.1
- npm version:
8.5.2
Step to reproduce
- npm install honkit --save-dev
- npx honkit init
- move
node_modules
to other (common) folder:../../generated/honkit/node_modules
- create ln(soft link) for
node_modules
:ln -s ../../generated/honkit/node_modules node_modules
- npx honkit serve
- change content -> trigger reload, but infinite reload, reload dead forever
- Link to code example:
Expected results
NO infinite reload == no reload deadlock
Actual results
infinite reload == reload deadlock
azu commented
honkit/packages/honkit/src/cli/watch.ts
Lines 23 to 27 in 4a439e5
Probably, We can avoid infinity loop by adding
node_modules
to ignored
pattern.However, I don't understand if it resolve all symlink issue.
Crifan Li commented
Thanks for your reply.
Final worked by add node_modules
to ignored
list:
honkit/lib/cli/watch.js
const watcher = chokidar_1.default.watch(toWatch, {
cwd: dir,
// ignored: "_book/**",
ignored: ["_book/**", "node_modules/**"],
ignoreInitial: true,
});
-> so
- here:
ignored
work forln -s
symlink- If not work, others may try
followSymlinks
forchokidar
'swatcher
- If not work, others may try