microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
451 stars 90 forks source link

Detailed results for estimates widget all show "ERROR: Rendered has not been set" #1880

Closed swernli closed 3 weeks ago

swernli commented 2 months ago

When using the widgets to display a resource estimation result, if the checkbox for "Show detailed rows" is selected, then each of the detailed explanations' text start with "ERROR: Rendered has not been set." Not sure where exactly that's coming from, but I wonder if it is a side of effect of trying to display LaTex in the paragraphs?

image
idavis commented 2 months ago

There error is typo. The renderer has no been set. See npm/qsharp/ux/rederers.tsx. When working in notebooks we need to ensure the default renderer is replaced with a call to setRenderer.

// Default renderer to be replaced before components are first used.
// Expectation is that this will convert markdown and/or LaTeX to HTML.
let theRenderer = function (input: string): string {
  const err = "ERROR: Rendered has not been set";
  console.error(err);
  return err + ". " + input;
};

export function setRenderer(renderer: (input: string) => string) {
  theRenderer = renderer;
}
billti commented 3 weeks ago

Fixed in #1957