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

fix: type storyIdToEntry explicitly #19123

Merged
merged 1 commit into from
Sep 13, 2022
Merged

Conversation

SimenB
Copy link
Contributor

@SimenB SimenB commented Sep 7, 2022

Issue: N/A

What I did

Trying to test out v7, and I get this error:

../../node_modules/@storybook/store/dist/types/StoryStore.d.ts:32:54 - error TS2307: Cannot find module 'lib/addons/dist/types/types' or its corresponding type declarations.

32     storyIdToEntry(storyId: StoryId): Promise<import("lib/addons/dist/types/types").IndexEntry>;

Explicitly typing it should fix it 🙂 (it works in my node_module at least)

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@shilman shilman added maintenance User-facing maintenance tasks typescript labels Sep 7, 2022
@shilman
Copy link
Member

shilman commented Sep 7, 2022

@SimenB Can you help us understand the problem better by telling us how to reproduce? We're not seeing this in dev or CI. Thank you! 🙏

@SimenB
Copy link
Contributor Author

SimenB commented Sep 8, 2022

You can just look in your output code: https://www.runpkg.com/?@storybook/[email protected]/dist/types/StoryStore.d.ts#32

A mapping of "lib/addons/* only works if there's actually a lib folder there - there's only dist

@SimenB
Copy link
Contributor Author

SimenB commented Sep 9, 2022

@shilman if you want a reproduction: https://github.com/SimenB/storybook-store-type-error


Seems there's also a missing dep on @storybook/core-common, but that's not an issue in my real project as it's pulled in by a whole bunch of modules (addon-controls, cli, core-server etc).

Also need to install @types/webpack-env, @types/node etc. - would be nice if you provided them yourself 😀

@ndelangen ndelangen merged commit 11ec40b into storybookjs:next Sep 13, 2022
@SimenB SimenB deleted the patch-1 branch September 13, 2022 11:30
@SimenB
Copy link
Contributor Author

SimenB commented Sep 13, 2022

Just missed v7.0.0-alpha.33 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants