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

All UML image are broken for executing npm run serve twice. #23

Closed
yumeto-yamagishi opened this issue Aug 31, 2021 · 8 comments
Closed

Comments

@yumeto-yamagishi
Copy link

yumeto-yamagishi commented Aug 31, 2021

Problem

UML diagrams are not shown (seems as broken link) on localhost serving (http://localhost:4000/) by npx honkit serve.
This is happen at the second time to run npx honkit serve, without deleting any generated directories or files.

Reproduce process

In the root dir of some Honkit's contents repository, emulating a "just after cloning" condition.

$ git clean -f
$ npm install
$ npx honkit serve

No problem is found until here. (All UML diagram are shown at http://localhost:4000/ )

Enter CTRL+C to stop serving process, then:

$ npx honkit serve

Access http://localhost:4000/, this problem happens.

Additional Info

  • When the first time to run npx honkit serve, _book/assets/images/uml dir is created and images are copied.
  • When the second time to run npx honkit serve, _book/assets dir is deleted automatically and not created.
  • $repository_root/assets/images/uml dir and the generated images are remains.
  • The same problem are happen for running npx honkit build twice.
  • When I delete $repository_root/assets/images/uml manually and run npx honkit serve, the problem was fixed temporary.
@yumeto-yamagishi
Copy link
Author

Is anyone here?
If this is not an issue, please close this.
Thanks.

@vowstar
Copy link
Owner

vowstar commented Sep 23, 2021

Sorry for late reply, I was traveling some time ago and just came back

@vowstar
Copy link
Owner

vowstar commented Sep 23, 2021

I tried to reproduce the problem, but found it strange.

The order of my execution commands is as follows:

$ npm -v
6.13.4
$ node -v
v12.9.1
$  uname -a
Linux t480 5.14.5-gentoo-x86_64 #1 SMP Fri Sep 17 22:51:55 CST 2021 x86_64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz GenuineIntel GNU/Linux

And I build up a test environment:

$ npm install honkit --save-dev
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN saveError ENOENT: no such file or directory, open '/home/vowstar/Projects/2020/honkit/cjk_nested_test/package.json'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open '/home/vowstar/Projects/2020/honkit/cjk_nested_test/package.json'
npm WARN cjk_nested_test No description
npm WARN cjk_nested_test No repository field.
npm WARN cjk_nested_test No README data
npm WARN cjk_nested_test No license field.

+ honkit@3.6.21
added 316 packages from 340 contributors and audited 833 packages in 38.318s

14 packages are looking for funding
  run `npm fund` for details

found 224 vulnerabilities (82 low, 64 moderate, 78 high)
  run `npm audit fix` to fix them, or `npm audit` for details

$ npm install gitbook-plugin-uml --save-dev
npm WARN saveError ENOENT: no such file or directory, open '/home/vowstar/Projects/2020/honkit/cjk_nested_test/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/vowstar/Projects/2020/honkit/cjk_nested_test/package.json'
npm WARN cjk_nested_test No description
npm WARN cjk_nested_test No repository field.
npm WARN cjk_nested_test No README data
npm WARN cjk_nested_test No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ gitbook-plugin-uml@1.2.11
updated 1 package and audited 1070 packages in 9.078s

14 packages are looking for funding
  run `npm fund` for details

found 224 vulnerabilities (82 low, 64 moderate, 78 high)
  run `npm audit fix` to fix them, or `npm audit` for details

The version I've installed is:

  • honkit@3.6.21
  • gitbook-plugin-uml@1.2.11

Then I tried to reproduce this issue:

$ npx honkit build                         
info: 6 plugins are installed 
info: 6 explicitly listed 
info: plugin "uml" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 3 pages 
info: found 4 asset files 
warn: "book" property is deprecated, use "this" directly instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "options" property is deprecated, use config.get(key) instead 
info: >> generation finished with success in 1.3s ! 
$ ls _book/assets/images/uml                                              
b25548fd30f84bae07fd6b18e02a5015fe3531d2.svg
$ npx honkit build          
info: 6 plugins are installed 
info: 6 explicitly listed 
info: plugin "uml" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 3 pages 
info: found 4 asset files 
warn: "book" property is deprecated, use "this" directly instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "options" property is deprecated, use config.get(key) instead 
info: >> generation finished with success in 0.4s ! 
$ ls _book/assets/images/uml
b25548fd30f84bae07fd6b18e02a5015fe3531d2.svg
$ npx honkit build          
info: 6 plugins are installed 
info: 6 explicitly listed 
info: plugin "uml" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 3 pages 
info: found 4 asset files 
warn: "book" property is deprecated, use "this" directly instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "options" property is deprecated, use config.get(key) instead 
info: >> generation finished with success in 0.4s ! 
$ ls _book/assets/images/uml
b25548fd30f84bae07fd6b18e02a5015fe3531d2.svg
$ npx honkit serve          
Live reload server started on port: 35729
Press CTRL+C to quit ...

Starting server ...
info: 7 plugins are installed 
info: 7 explicitly listed 
info: plugin "uml" is loaded
info: plugin "livereload" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 3 pages 
info: found 4 asset files 
warn: "book" property is deprecated, use "this" directly instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "options" property is deprecated, use config.get(key) instead 
info: >> generation finished with success in 1.0s ! 
Serving book on http://localhost:4000
^C
$ ls _book/assets/images/uml
b25548fd30f84bae07fd6b18e02a5015fe3531d2.svg
$ npx honkit serve          
Live reload server started on port: 35729
Press CTRL+C to quit ...

Starting server ...
info: 7 plugins are installed 
info: 7 explicitly listed 
info: plugin "uml" is loaded
info: plugin "livereload" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 3 pages 
info: found 4 asset files 
warn: "book" property is deprecated, use "this" directly instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "options" property is deprecated, use config.get(key) instead 
info: >> generation finished with success in 1.6s ! 
Serving book on http://localhost:4000
^C
$ ls _book/assets/images/uml
b25548fd30f84bae07fd6b18e02a5015fe3531d2.svg
$ npx honkit serve          
Live reload server started on port: 35729
Press CTRL+C to quit ...

Starting server ...
info: 7 plugins are installed 
info: 7 explicitly listed 
info: plugin "uml" is loaded
info: plugin "livereload" is loaded
info: plugin "highlight" is loaded
info: plugin "search" is loaded
info: plugin "lunr" is loaded
info: plugin "fontsettings" is loaded
info: plugin "theme-default" is loaded
info: found 3 pages 
info: found 4 asset files 
warn: "book" property is deprecated, use "this" directly instead 
warn: "this.generator" property is deprecated, use "this.output.name" instead 
warn: "navigation" property is deprecated 
warn: "options" property is deprecated, use config.get(key) instead 
info: >> generation finished with success in 1.7s ! 
Serving book on http://localhost:4000
^C
$ ls _book/assets/images/uml
b25548fd30f84bae07fd6b18e02a5015fe3531d2.svg

I've run both npx honkit build and npx honkit serve 3 times in the above order respectively, but can't reproduce this issue.

So I can only make a speculative bug fix update.

The file I've test:
cjk_nested_test.zip

Could you provide more detailed demo files or try the latest version?

@vowstar
Copy link
Owner

vowstar commented Sep 23, 2021

@yumeto-yamagishi
Copy link
Author

Thanks for your checks.
I found the very strange phenomena. I can't explain reproduce procedure.

The first time, unzip the file you provided and try to build, then the issue did NOT happen.
In the same testing folder I replaced all files with mine, then the issue DID happen. (This is the expected result.)
Again in the same folder I replaced all files with unzipped ones you provided, then the issue STILL DID happen!!

This means, my source, config or environment is a trigger of causing issue, but another factor (something like cache?) exists.

My MacOS env (where the issue happens):

$ npm -v
6.14.14
$ node -v
v14.17.4
$ uname -a
Darwin yumeto 19.6.0 Darwin Kernel Version 19.6.0: Tue Aug 24 20:28:00 PDT 2021; root:xnu-6153.141.40~1/RELEASE_X86_64 x86_64

Note:

  • The issue still happens after updating to gitbook-plugin-uml@1.2.12 with my source.

@yumeto-yamagishi
Copy link
Author

I can't provide the source causing the issue because it's owned by my customer.

I'll try to create a sample that always cause the issue.
But it may take a time.

@misakayao
Copy link

According to my verification, this happens if book.js is configured with root and is not in the same directory as docs.

@misakayao
Copy link

misakayao commented Oct 27, 2022 via email

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

3 participants