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

Typescript build fail when removing @types/storybook__react #8110

Closed
sami616 opened this issue Sep 18, 2019 · 8 comments · Fixed by #8119
Closed

Typescript build fail when removing @types/storybook__react #8110

sami616 opened this issue Sep 18, 2019 · 8 comments · Fixed by #8119

Comments

@sami616
Copy link

sami616 commented Sep 18, 2019

My understanding is that the @types package is no longer needed for @storybook/react. However when i uninstall the module i get the below error when trying to build my project.

ERROR in [at-loader] ./node_modules/@storybook/react/dist/client/preview/index.d.ts:2:23 
    TS2688: Cannot find type definition file for 'webpack-env'.

Have i misunderstood ?

@shilman
Copy link
Member

shilman commented Sep 19, 2019

This might be a typing bug. @kroeder fixed this for Angular by removing those typings from tsconfig.json, but it seems like maybe we need to do that across the board.

@hipstersmoothie
Copy link
Contributor

I can remove that line from my node_modules and see if it build. If it does I can remove them all for the different apps and add that to my PR

@shilman
Copy link
Member

shilman commented Sep 19, 2019

Just to be clear, I don't know what the right fix is. Maybe we need to add the dep across the board. Maybe we need to move it from tsconfig.json across the board. Or maybe it's case by case. I don't know enough about what's going on, just making sure the right hand is talking to the left. 😅

@sami616
Copy link
Author

sami616 commented Sep 19, 2019

Just to confirm, i'm now not seeing this oddly, i think it may be linked to addon-docs, which im having trouble setting up with TS. Will investigate further and come back to you! Thanks!

@hipstersmoothie
Copy link
Contributor

If it's a needed type it for sure needs to be moved from devDeps to deps somewhere.

@ndelangen
Copy link
Member

#8119

ndelangen added a commit that referenced this issue Sep 25, 2019
fix: add @types/webpack-env to apps that depend on it, fixes #8110
@shilman
Copy link
Member

shilman commented Sep 25, 2019

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.3 containing PR #8119 that references this issue. Upgrade today to try it out!

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

shilman pushed a commit that referenced this issue Oct 7, 2019
fix: add @types/webpack-env to apps that depend on it, fixes #8110
@shilman
Copy link
Member

shilman commented Oct 7, 2019

Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.2 containing PR #8119 that references this issue. Upgrade today to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants