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

Preview is very slow and sometimes fails #927

Closed
AlessandroVol23 opened this issue Jan 4, 2025 · 11 comments
Closed

Preview is very slow and sometimes fails #927

AlessandroVol23 opened this issue Jan 4, 2025 · 11 comments
Labels

Comments

@AlessandroVol23
Copy link

When I open my asciidoc preview in vs-code the preview takes a long time to open.
It also sometimes fails with the error message: Error: Webview is disposed

image

I didn't had this issue when I created the documents initially. I'm opening it again on the same machine and the time the preview needs to open and to update takes very long.

Here is a video which shows the issue:

https://www.loom.com/share/14a5c23183ed41239f1e7797ffd79271

The initial wait time in the video is fine I can live with that. But the update times are really bad IMO.

System Information
Version: 0.44.9
VSCode Version: 1.93.1
Commit: 316e524257c2ea23b755332b0a72c50cf23e1b00
Date: 2024-12-26T21:58:59.149Z (1 wk ago)
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.4.0

I run it in cursor but have the same problems in code.

Any idea how to debug or fix that?

@ggrossetie
Copy link
Member

You should "Toggle Developer Tools" and make sure that Antora support is disabled.

The initial wait time in the video is fine I can live with that. But the update times are really bad IMO.

Indeed that's painfully slow, something is definitely not working as expected 😞

@AlessandroVol23
Copy link
Author

Thanks for the fast response! I'm not sure how to do that. Do you mean toggling the chrome dev tools in code?

@ggrossetie
Copy link
Member

I'm not sure how to do that. Do you mean toggling the chrome dev tools in code?

Yes, exactly.
You can search for "Toggle Developer Tools" in the command palette or click on "Help" > "Toggle Developer Tools".

@AlessandroVol23
Copy link
Author

I'm not sure how to do that. Do you mean toggling the chrome dev tools in code?

Yes, exactly. You can search for "Toggle Developer Tools" in the command palette or click on "Help" > "Toggle Developer Tools".

Yep I found that but I don't know how to deactivate Antora 🤔
Like in the console or how do I deactivate this with the dev tools?

@ggrossetie
Copy link
Member

Sorry that was two separate things. You should enable the "Developer Tools" and check if you don't have any error message in the console.

And second, you should check that Antora support is disabled in the configuration/settings. Using the command palette "AsciiDoc: Enable/Disable Antora support in this workspace".

@AlessandroVol23
Copy link
Author

Alright thanks! Sorry for the confusion :D

Antora is enabled ✅

I'll check for errors as well and update this issue, thanks

@AlessandroVol23
Copy link
Author

AlessandroVol23 commented Jan 8, 2025

So, if I open up the whole document (pdf.adoc) which includes all chapters the updates take now even longer I think. At least 2-3 minutes.

I do see some errors about unsupported languages we use but we haven't changed that. Does it make a difference to remove them?

Here are some errors that appeared:

image

workbench.desktop.main.js:465 [25ad] potential listener LEAK detected, having 236 listeners already. MOST frequent listener (62):
check @ workbench.desktop.main.js:465
q @ workbench.desktop.main.js:468
C @ workbench.desktop.main.js:470
C @ workbench.desktop.main.js:1173
readFileStream @ workbench.desktop.main.js:1173
await in readFileStream (async)
r @ workbench.desktop.main.js:2598
zb @ workbench.desktop.main.js:2703
(anonymous) @ workbench.desktop.main.js:2703
(anonymous) @ workbench.desktop.main.js:2703
H.onmessage @ workbench.desktop.main.js:2703
workbench.desktop.main.js:465 Error
    at g.create (workbench.desktop.main.js:465:58394)
    at E.q (workbench.desktop.main.js:468:1100)
    at new C (workbench.desktop.main.js:470:8990)
    at l.C (workbench.desktop.main.js:1173:24685)
    at l.readFileStream (workbench.desktop.main.js:1173:24649)
    at async r (workbench.desktop.main.js:2598:38245)
    at async l.zb (workbench.desktop.main.js:2703:28454)
check @ workbench.desktop.main.js:465
q @ workbench.desktop.main.js:468
C @ workbench.desktop.main.js:470
C @ workbench.desktop.main.js:1173
readFileStream @ workbench.desktop.main.js:1173
await in readFileStream (async)
r @ workbench.desktop.main.js:2598
zb @ workbench.desktop.main.js:2703
(anonymous) @ workbench.desktop.main.js:2703
(anonymous) @ workbench.desktop.main.js:2703
H.onmessage @ workbench.desktop.main.js:2703
workbench.desktop.main.js:465 [25ad] potential listener LEAK detected, having 324 listeners already. MOST frequent listener (150):
check @ workbench.desktop.main.js:465
q @ workbench.desktop.main.js:468
C @ workbench.desktop.main.js:470
C @ workbench.desktop.main.js:1173
readFileStream @ workbench.desktop.main.js:1173
await in readFileStream (async)
r @ workbench.desktop.main.js:2598
zb @ workbench.desktop.main.js:2703
(anonymous) @ workbench.desktop.main.js:2703
(anonymous) @ workbench.desktop.main.js:2703
H.onmessage @ workbench.desktop.main.js:2703
workbench.desktop.main.js:465 Error
    at g.create (workbench.desktop.main.js:465:58394)
    at E.q (workbench.desktop.main.js:468:1100)
    at new C (workbench.desktop.main.js:470:8990)
    at l.C (workbench.desktop.main.js:1173:24685)
    at l.readFileStream (workbench.desktop.main.js:1173:24649)
    at async r (workbench.desktop.main.js:2598:38245)
    at async l.zb (workbench.desktop.main.js:2703:28454)

I tried it again with opening up the preview for a single chapter and I got these errors:

image

image

Is there something we should change on our side? We did write a book with it with many images so it is not super small. But I also don't think a huge project

@ggrossetie
Copy link
Member

Antora is enabled ✅

Are you using Antora? Could you try to disable it? (the current implementation can consume a lot of resources).

Is there something we should change on our side? We did write a book with it with many images so it is not super small. But I also don't think a huge project

Would it be possible to share it with me? I cannot see anything wrong...
Could you please also try to disable the cursor sync between the editor and the preview (from the extension settings)?

@asciidoctor asciidoctor deleted a comment from WyxXu Jan 11, 2025
@AlessandroVol23
Copy link
Author

Unfortunately, I can't share it but I think I could solve it. I had a monorepo structure where I have both of my books.
I moved out the book into its own repository and everything works again as expected. So, I think that was the issue.

Antora didn't help (enabled or disabled).

Thanks for your help! I'm closing this one now. If I can give you any other information for debugging this issue please let me know. Appreciate the help 🙏🏽

@ggrossetie
Copy link
Member

@AlessandroVol23 Could you share the tree structure/outline? I can generate lorem ipsum text to try to reproduce.

I had a monorepo structure where I have both of my books.
I moved out the book into its own repository and everything works again as expected

And there was no reference between the books? That's weird 🤔

@AlessandroVol23
Copy link
Author

@AlessandroVol23 Could you share the tree structure/outline? I can generate lorem ipsum text to try to reproduce.

I had a monorepo structure where I have both of my books.
I moved out the book into its own repository and everything works again as expected

And there was no reference between the books? That's weird 🤔

No at least no intentional reference. I could easily copy out the folder and it worked in another one so I don't think there was any reference.

The outline looked like that:

  • content
    -- book1
    --- chapters
    --- pdf.adoc
    --- epub.adoc
    -- book2
    --- chapters
    --- pdf.adoc
    --- epub.adoc

That is basically it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants