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

Starting over to fix migration, can't get preset-typescript to work #51

Closed
mattfelten opened this issue Nov 6, 2019 · 3 comments
Closed
Labels
question Further information is requested typescript

Comments

@mattfelten
Copy link
Contributor

I've been having a lot of trouble updating Storybook from 5.1.9 to 5.2.5 and part of that is the Typescript setup we have. I threw my hands up and started an entire new project to at least get a build working, and then I can integrate it into my existing project. Even that doesn't work.

Basic example
https://github.com/mattfelten/storybook-preset-typescript-test

The one story here is not being found. I followed the docs. What am I missing?

@shilman
Copy link
Member

shilman commented Nov 6, 2019

Your config:

configure(require.context('../stories', true, /.stories.tsx$/), module);

Your story file: Test.story.tsx

Once I rename to Test.stories.tsx it tries to load, but fails because there is more setup to do.

Storybook is meant to be added to an existing working app, not bootstrapped in an empty directory. To get it working I also needed to yarn add typescript --dev and create a tsconfig.json.

@shilman shilman added question Further information is requested typescript labels Nov 6, 2019
@mattfelten
Copy link
Contributor Author

Gotcha. I'll keep working on this. I know this isn't the correct way of setting it up, but I'm having trouble with some dependencies (storybookjs/storybook#8730) so just trying to isolate whether it's our project or I'm misconfiguring something.

@mattfelten
Copy link
Contributor Author

Got it working. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested typescript
Projects
None yet
Development

No branches or pull requests

2 participants