Storybook: hrefTo throws an error when kind is not supplied

Created on 19 May 2019  路  6Comments  路  Source: storybookjs/storybook

Describe the bug
Can't use hrefTo without supplying both kind and story

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://next--storybooks-official.netlify.com/?path=/story/addons-links-link--first
  2. See error in console: Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined
  3. Link's href points to root instead of the linked story

Probably broken by https://github.com/storybooks/storybook/commit/a9d356444c75124ee0f1ff6a85a5604ee0b82ff6. Before the change, the missing kind and story parameters were handled by api.getUrlState

links bug inactive

Most helpful comment

Hi everyone,
I have the same problem as @Hypnosphi, I installed create-react-native-app with storybook (v5.1.9).

DevDependencies:
-"@storybook/addon-actions": "^5.1.9",
-"@storybook/addon-links": "^5.1.9",
-"@storybook/addons": "^5.1.9",
-"@storybook/react-native": "^5.1.9",
-"@storybook/react-native-server": "^5.1.9",

Dependencies:
-"react": "16.8.3",
-"react-native": "0.59.9"

See error in console: Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined

Would anyone have been able to fix the problem, please?

All 6 comments

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@Hypnosphi Hi, I'm just curious. For fixing those errors, passing kind to the <LinkTo> component worked fine. Is this supposed to work without explicitly passing kind?

Yes, in that case it should preserve the current kind. Quite useful for navigating inside a kind.
That's how it worked before the changes from https://github.com/storybookjs/storybook/commit/a9d356444c75124ee0f1ff6a85a5604ee0b82ff6

Hi everyone,
I have the same problem as @Hypnosphi, I installed create-react-native-app with storybook (v5.1.9).

DevDependencies:
-"@storybook/addon-actions": "^5.1.9",
-"@storybook/addon-links": "^5.1.9",
-"@storybook/addons": "^5.1.9",
-"@storybook/react-native": "^5.1.9",
-"@storybook/react-native-server": "^5.1.9",

Dependencies:
-"react": "16.8.3",
-"react-native": "0.59.9"

See error in console: Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined

Would anyone have been able to fix the problem, please?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wahengchang picture wahengchang  路  3Comments

ZigGreen picture ZigGreen  路  3Comments

xogeny picture xogeny  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

purplecones picture purplecones  路  3Comments