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.

Support absolute anchors when Storybook is deployed at non-root

See original GitHub issue

Describe the bug

When Storybook is deployed at an URL like https://example.com/storybook/component-library/v48.3.2/, the anchors within docs content will remove the base url.

E.g. when you’re on https://example.com/storybook/component-library/v48.3.2/?path=/docs/components-icon--default and you have a link to /docs/components-button--default in the documentation, the resulting link will point to https://example.com/?path=/docs/components-button--default.

To Reproduce

Steps to reproduce the behavior:

  1. Build a storybook locally
  2. Run npx http-server in a parent folder
  3. Navigate to the storybook
  4. Try clicking on a link as described above and it will fail

Expected behavior

The base url of the deployment should be considered for the link.

System:

  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 12.3.1 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.3 - ~/Projects/alpine/component-library/node_modules/.bin/npm
  Browsers:
    Chrome: 83.0.4103.116
    Edge: 81.0.416.53
    Firefox: 77.0.1
    Safari: 13.1
  npmPackages:
    @storybook/addon-actions: ^5.3.19 => 5.3.19 
    @storybook/addon-docs: ^5.3.19 => 5.3.19 
    @storybook/addon-storyshots: ^5.3.19 => 5.3.19 
    @storybook/addons: ^5.3.19 => 5.3.19 
    @storybook/csf: ^0.0.1 => 0.0.1 
    @storybook/react: ^5.3.19 => 5.3.19 
    @storybook/theming: ^5.3.19 => 5.3.19 

Additional context

I’ve created a PR that should solve this here: https://github.com/storybookjs/storybook/pull/11403

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shilmancommented, Jul 30, 2020

Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-rc.19 containing PR #11403 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there’s still more to do.

0reactions
anatelcommented, Jun 18, 2021

Cool, hope it’ll be merged soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

storybook 6.0.0-rc.19 on Node.js Yarn - NewReleases.io
New release storybook version 6.0.0-rc.19 on Node.js Yarn. ... Addon-docs: Support absolute anchors when deployed at non-root (#11403) ...
Read more >
Publish Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
@storybook/addon-jest | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Apache HBase ™ Reference Guide
Commercial technical support for Apache HBase is provided by many Hadoop ... HBase runs on the Java Virtual Machine, thus all HBase deployments...
Read more >
TADDM Capabilities and Best Practices - IBM Redbooks
8.1 Integrating TADDM with IBM Tivoli Business Service Manager . . . . . . . 381 ... Depending on your network, you...
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