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

Missing --timeout option in vivliostyle preview command #515

Open
U-1F992 opened this issue Sep 19, 2024 · 0 comments
Open

Missing --timeout option in vivliostyle preview command #515

U-1F992 opened this issue Sep 19, 2024 · 0 comments

Comments

@U-1F992
Copy link
Sponsor

U-1F992 commented Sep 19, 2024

vivliostyle buildには--timeoutオプションがありますが、vivliostyle previewでは30000ms固定になっています。--timeoutオプションを追加するのは有用でしょうか。

$ head -c 256 very_long.html; echo " ..."; tail -c 256 very_long.html; wc -m very_long.html
<!doctype html><html lang="ja"><head><style>@page{size:A4;} :root{--var-0:93%;--var-1:12%;--var-2:61%;--var-3:69%;--var-4:14%;--var-5:46%;--var-6:11%;--var-7:72%;--var-8:41%;--var-9:11%;--var-10:17%;--var-11:86%;--var-12:85%;--var-13:90%;--var-14:56%;--var ...
-var-65524:1%;--var-65525:13%;--var-65526:87%;--var-65527:32%;--var-65528:11%;--var-65529:3%;--var-65530:41%;--var-65531:38%;--var-65532:61%;--var-65533:96%;--var-65534:66%;--var-65535:1%;}</style></head><body><p>verrrrrrrrrry long html</p></body></html>
1031829 very_long.html

$ vivliostyle build --timeout 60000 very_long.html
⊙ Building pages
output.pdf has been created.
🎉 Built successfully.

$ vivliostyle preview very_long.html
✖ locator.focus: Timeout 30000ms exceeded.
Call log:
  - waiting for locator('#vivliostyle-input-url')

    at openPreview (C:\Users\mukai\AppData\Roaming\nvm\v20.13.1\node_modules\@vivliostyle\cli\dist\preview.js:117:54)
    at async preview (C:\Users\mukai\AppData\Roaming\nvm\v20.13.1\node_modules\@vivliostyle\cli\dist\preview.js:128:5)

If you think this is a bug, please report at https://github.com/vivliostyle/vivliostyle-cli/issues

$ vivliostyle preview --timeout 60000 very_long.html
error: unknown option '--timeout'
検証用
import sys
import random

print(
    '<!doctype html><html lang="ja"><head><style>@page{size:A4;} :root{'
    + "".join([f"--var-{i}:{random.randint(0, 100)}%;" for i in range(int(sys.argv[1]))])
    + "}</style></head><body><p>verrrrrrrrrry long html</p></body></html>"
)
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

1 participant