Skip to content

ERROR: "No inspectable targets"-error when rendering PDF containing Mermaid diagram #4653

Closed

Description

@streepvaren

Bug description

Hello,

Í'm using:

  • Latest version of R (4.2.2)
  • Latest version of Rstudio (2022.12.0 Build 353)
  • Latest Quarto (version 1.2.335)
  • Windows 10 Enterprise 22H2

When rendering a PDF from a .QMD-file containing a Mermaid diagram (https://quarto.org/docs/authoring/diagrams.html), my Rstudio gives the error "ERROR: No inspectable targets" and crashes (I'm unable to press stop).
In the past the same .QMD file rendered to PDF without any problem. Rendering to .HTML still works. The same error was recently reported by an Obsidian user: https://forum.obsidian.md/t/about-quarto-no-inspectable-targets-error/54757.

The .QMD-file i'm using can be found in the attached .ZIP (Github doesn't allow uploading QMD's directly, therefore I zipped).

Thanks for the good work!

Best,
Thomas

testdia.zip

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Activity

  1. added
    needs-reproIssues that are blocked until reporter provides an adequate reproduction
    on Mar 6, 2023
  2. cscheid commented on Mar 6, 2023

    @cscheid
    Member

    Can you try with our 1.3 prereleases? I'm not on windows, but I can't reproduce the issue:

    image

  3. streepvaren commented on Mar 6, 2023

    @streepvaren
    Author

    Dear Carlos,

    After installing the 1.3.247 prerelease I still get the error when rendering a PDF (HTML works fine).

    This time the error is more complex:

    ERROR: No inspectable targets
    
    Error: No inspectable targets
        at defaultTarget (file:///C:/Users/20003963/AppData/Local/Programs/Quarto/bin/quarto.js:55313:23)
        at Chrome._fetchDebuggerURL (file:///C:/Users/20003963/AppData/Local/Programs/Quarto/bin/quarto.js:55436:37)
        at async Chrome._start (file:///C:/Users/20003963/AppData/Local/Programs/Quarto/bin/quarto.js:55392:25)
    

    I'm using the latest version of Google Chrome (110.0.5481.178 (Official build) (64-bits))

    Best regards,
    Thomas

  4. cscheid commented on Mar 6, 2023

    @cscheid
    Member

    @cderv will know the details, but there are issues with Windows and headless Chrome.

  5. cderv commented on Mar 6, 2023

    @cderv
    Member

    I can reproduce with using Chrome browser from my system.

    It works ok if I use chromium install with Quarto quarto install tools chromium - something must have changed with newest Chrome browser. I need to look into that.

    Doc from the Zip to reproduce

    ---
    title: "TestDiagram"
    format: pdf
    editor: visual
    ---
    
    ## Quarto
    
    
    ```{mermaid}
    flowchart TD
        A[Christmas] -->|Get money| B(Go shopping)
        B --> C{Let me think}
        C -->|One| D[Laptop]
        C -->|Two| E[iPhone]
        C -->|Three| F[fa:fa-car Car]
    ```
  6. removed
    needs-reproIssues that are blocked until reporter provides an adequate reproduction
    on Mar 6, 2023
  7. added this to the v1.3 milestone on Mar 6, 2023
  8. streepvaren commented on Mar 6, 2023

    @streepvaren
    Author

    Thank you very much for the quick help @cscheid and @cderv! quarto install tools chromium fixed the problem!

    Best regards,
    Thomas

  9. cderv commented on Mar 6, 2023

    @cderv
    Member

    @cscheid I reopened as I think it should be solves for any Chrome browser. Or do you consider our internal chromium to be the solution and we keep it closed ?

    Here are some details on what is happening

    We are retrieving the debugger url

    const url = await this._fetchDebuggerURL(options);

    For that some targets are looked into , default being using defaultTarget function

    this.target = options.target || defaultTarget;

    For the default targets we are calling

    const targets = await devtools.List(options);
    const result = func(targets);

    which query json/list endpoint, calling defaultTarget() on it.

    I don't know yet why but with the Chrome browser version mentioned above, this will be empty

    targets
    (0) []
    

    No targets to inspect.

    This why code currently throw the error from

    target = target || backup;
    if (target) {
    return target;
    } else {
    throw new Error("No inspectable targets");
    }

    Maybe we need to open a target if none exists (devtools.New()). FWIW, testing with chromium from quarto install, the targets to explore was about:blank

    $ targets
    [
      {
        description: "",
        devtoolsFrontendUrl: "/devtools/inspector.html?ws=localhost:9222/devtools/page/BA596C8DC87F7F55499F46F0EC363E27",
        id: "BA596C8DC87F7F55499F46F0EC363E27",
        title: "about:blank",
        type: "page",
        url: "about:blank",
        webSocketDebuggerUrl: "ws://localhost:9222/devtools/page/BA596C8DC87F7F55499F46F0EC363E27",
      },
    ]
    

    @cscheid hope it helps you know what can be done. I'll look closer tomorrow about why we get this in Chrome now and maybe try the fix suggested above

    and crashes (I'm unable to press stop).

    I reproduce this also. We throw the error and then impossible to stop Quarto.

  10. reopened this on Mar 6, 2023
  11. tomkom commented on Mar 13, 2023

    @tomkom

    I can confirm this works now, with one small caveat ( that tripped me for a while). The required chromium triggers a "Chromium unexpectedly quit" menu on Mac. I guess this is a little process that runs, and then kills itself, but it triggers an ugly ( although, as I found out, inconsequential) message on Mac OSX Ventura.

  12. cscheid commented on Mar 13, 2023

    @cscheid
    Member

    @tomkom Oof, that's really no good. I'm on OSX Ventura as well and thought I had fixed this issue.

    I'm no longer seeing the crash, but clearly the fix didn't stick. I take it back; I see the crash once again.

  13. cscheid commented on Mar 14, 2023

    @cscheid
    Member

    Unfortunately, I can't seem to make the crash stop with Chromium on OS X Ventura.

    So, we're changing the resolution order of browsers. If we find Google Chrome (for which the crash doesn't happen), then we use that directly, even if the user has installed Chromium.

    We will still use Chromium if we don't find Google Chrome, but using Chromium will likely cause this crash.

  14. rgayler commented on Apr 2, 2023

    @rgayler

    I am getting the original problem "ERROR: No inspectable targets" rendering mermaid and dot diagram to PDF (HTML works OK).

    Ubuntu 22.04.2
    R 4.2.2
    RStudio 2023.03-0 build 386
    quarto 1.2.335
    chrome installed
    chromium installed
    quarto install tools chromium installed

    Let me know if there's something diagnostic I can do to get some more info on what's happening here.

    Thanks.

  15. cscheid commented on Apr 2, 2023

    @cscheid
    Member

    quarto 1.2.335

    You need to download and install a newer version of quarto.

  16. rgayler commented on Apr 2, 2023

    @rgayler

    Thanks @cscheid - that worked perfectly. I had misread the quarto version number and wrongly believed I was using the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions