question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML stories misrender in canvas

See original GitHub issue

Describe the bug When Storybook first loads in a set of HTML stories in Canvas, the one selected on initial page load renders properly. The first story you navigate to afterward renders the raw HTML. Navigating away and back to it a second time, it renders properly.

To Reproduce Steps to reproduce the behavior:

  1. Run an HTML Storybook with multiple stories
  2. Load Storybook in the browser
  3. Click a story other than the initial one
  4. Observe the raw HTML
  5. Navigate to any other story and back to the problematic one
  6. Observe it renders properly

Expected behavior Stories render properly regardless of when/how you arrive at them.

Screenshots

bug

Code snippets

...

## Base alert

<Preview>
    <Story name='Base alert'>{`
        <div class="alert" role="alert">
          <span class="alert__icon">...</span>
          ${text('Alert text', 'Hello World', 'base')}
        </div>
    `}</Story>
</Preview>

## Info alert

<Preview>
    <Story name='Info alert'>{`
        <div class="alert alert--info" role="alert">
          <span class="alert__icon">...</span>
          ${text('Alert text', 'Info', 'info')}
        </div>
    `}</Story>
</Preview>

System:

Environment Info <div>
  System:
    OS: macOS Mojave 10.14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
    npm: 6.13.4 - ~/.nvm/versions/node/v12.4.0/bin/npm
  Browsers:
    Chrome: 79.0.3945.88
    Firefox: 71.0
    Safari: 12.1.1
  npmPackages:
    @storybook/addon-a11y: ^5.3.0-rc.0 => 5.3.0-rc.0
    @storybook/addon-docs: ^5.3.0-rc.0 => 5.3.0-rc.0
    @storybook/addon-knobs: ^5.3.0-rc.0 => 5.3.0-rc.0
    @storybook/addon-storysource: ^5.3.0-rc.0 => 5.3.0-rc.0
    @storybook/html: ^5.3.0-rc.0 => 5.3.0-rc.0
    @storybook/react: ^5.3.0-rc.0 => 5.3.0-rc.0
    @storybook/source-loader: ^5.3.0-rc.0 => 5.3.0-rc.0
</div>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
supersnagercommented, Apr 14, 2020

@daneah thank You for this comment. I did almost the same, and your explanation led me to my own bug 😃

1reaction
daneahcommented, Jan 26, 2020

Oh, I spoke slightly too soon and it looks like this is a big d’oh on our part. I tried uninstalling @storybook/react, which led me to an unexpected import of it inside our HTML preview.js…switching that to the expected @storybook/html import seems to have everything working properly. Funny that it mostly worked except for that 😂 I’m closing this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Future Web: Will Canvas Rendering Replace the DOM?
There's been a lot of hand-wringing recently about Google's decision to use the HTML <canvas> for all of its rendering in Google Docs....
Read more >
GDI ClearType rendered to RGBA surfaces sometimes looks ...
I want D3D and GL to support component alpha in transparent layers with text. See bug 593604 and bug 593733. That would fix...
Read more >
Rendering HTML elements to <canvas> - Stack Overflow
It will render html element using creating SVG images. For Example: There is <em>I</em> like <span style="color:white; text-shadow:0 ...
Read more >
What is another word for palter? - WordHippo
beg the question · tell stories · tell untruths · be economical with the truth ... misrender · meddle with · mess about...
Read more >
Part 1 - Creating new technologies for endangered languages
As you have access to this content, full HTML content is provided on this page. ... The corpus aligns versions of the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found