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

Relative links in md files are broken in v6.1.12 #13630

Closed
mgameover opened this issue Jan 13, 2021 · 9 comments
Closed

Relative links in md files are broken in v6.1.12 #13630

mgameover opened this issue Jan 13, 2021 · 9 comments
Assignees
Milestone

Comments

@mgameover
Copy link

mgameover commented Jan 13, 2021

Hi guys,

We are using md files to display component's documentation under Docs, some of those files have relative links to other stories.
For example:

[web](/docs/components-navigation-navigation-framework--default) 

which should navigate to http ://localhost:6006/?path=/docs/components-navigation-navigation-framework--default, but after updating SB from v6.1.11 to 6.1.12 it goes to http: //localhost:6006/iframe.html?path=/docs/components-navigation-navigation-framework--default.
As you can see, "iframe.html?" is being added to the url, as the result page cannot be found.

@shilman, @ndelangen, I took a look at the change log and it seems that it was broken here:
Addon-docs: Fix link not working cross origin (#13022)

System
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-4940MX CPU @ 3.10GHz
Binaries:
Node: 14.15.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 87.0.4280.141
Edge: Spartan (44.19041.423.0), Chromium (87.0.664.75)
npmPackages:
@storybook/addon-a11y: ^6.1.12 => 6.1.14
@storybook/addon-actions: ^6.1.12 => 6.1.14
@storybook/addon-docs: ^6.1.12 => 6.1.14
@storybook/addon-knobs: ^6.1.12 => 6.1.14
@storybook/addon-links: ^6.1.12 => 6.1.14
@storybook/addon-storysource: ^6.1.12 => 6.1.14
@storybook/addon-viewport: ^6.1.12 => 6.1.14
@storybook/addons: ^6.1.12 => 6.1.14
@storybook/angular: ^6.1.12 => 6.1.14
@storybook/source-loader: ^6.1.12 => 6.1.14

┆Issue is synchronized with this Asana task by Unito

@mgameover
Copy link
Author

Hi @shilman,
Have you got a chance to take a look at that? I've played with v6.2.0-rc.1, the issue is still there.
Do you know if there is a workaround?

Thank you.

@zolk
Copy link
Contributor

zolk commented Mar 24, 2021

I'm also running into this and have had to lock our Storybook installation at 6.1.11 to avoid numerous links in our docs breaking.

@shilman shilman added this to the 6.2 blocking milestone Mar 25, 2021
@ndelangen
Copy link
Member

Hello @mgameover,

I found a fix for this, should be fixed real soon. thanks for reporting!

@shilman
Copy link
Member

shilman commented Mar 26, 2021

Huzzah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-rc.10 containing PR #14334 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

@mgameover
Copy link
Author

Hi guys,
Hi @shilman,

Unfortunately, the issue has not been fixed.
I did a clean install of v6.2.0-rc.10 and still can see that "iframe.html?" is being added:
md:

[accessibility](/docs/design-guidelines--colors)

url:
image
console log:

Uncaught Error: Invalid path '/docs/design-guidelines--colors',  must start with '/story/'
    at pathToId (vendors~main.iframe.bundle.js:218678)
    at getSelectionSpecifierFromPath (vendors~main.iframe.bundle.js:218759)
    at Object.start (vendors~main.iframe.bundle.js:219649)
    at Object../node_modules/@storybook/angular/dist/ts3.9/client/preview/index.js (vendors~main.iframe.bundle.js:208679)
    at __webpack_require__ (runtime~main.iframe.bundle.js:854)
    at fn (runtime~main.iframe.bundle.js:151)
    at Object.<anonymous> (vendors~main.iframe.bundle.js:207286)
    at Object../node_modules/@storybook/angular/dist/ts3.9/client/index.js (vendors~main.iframe.bundle.js:207303)
    at __webpack_require__ (runtime~main.iframe.bundle.js:854)
    at fn (runtime~main.iframe.bundle.js:151)

npx sb@next info:
npmPackages:
@storybook/addon-a11y: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/addon-actions: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/addon-docs: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/addon-knobs: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/addon-links: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/addon-viewport: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/addons: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/angular: ^6.2.0-rc.10 => 6.2.0-rc.10
@storybook/source-loader: ^6.2.0-rc.10 => 6.2.0-rc.10

@mgameover
Copy link
Author

As I mentioned before it was broken in PR #13022

lib/components/src/typography/DocumentFormatting.tsx line 75-80
And it looks like it is not a part of addons/docs

Hope that helps, Thanks.

@shilman
Copy link
Member

shilman commented Mar 26, 2021

@mgameover Do you have a repro repo you can share? @ndelangen repro'd the problem in the monorepo and fixed our repro (you can check #14334 for details). If it doesn't fix your case, it would be useful to be able to try it, or at the very least understand how it differs from our repro.

@zolk
Copy link
Contributor

zolk commented Mar 26, 2021

Unfortunately I'm also still having this issue. In my case, I'm including md links as part of a JSDoc block in the component file. If I have some time today I can put together a repro repo, but hopefully that tidbit can provide more context.

@mgameover
Copy link
Author

Hi @shilman,

I've just created a repo: https://github.com/mgameover/sb-md-relative-links Please take a look.

To reproduce the issue:

  1. npm run storybook
  2. goto "Markdowm / Link test" story, "Docs" tab
  3. click on "test link"

Result:
You will be navigated to http://localhost:6006/iframe.html?path=/docs/markdown--target
Expected result:
You should be navigated to "Markdown / Target" story, "Docs" tab

Hope that helps

gabiseabra pushed a commit to gabiseabra/storybook that referenced this issue Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants