Cannot find type definition file for 'webpack-env'
See original GitHub issueDescribe the bug
Just importing addParameters into my story causes the build to break. It does not launch when you run yarn storybook or npm run storybook
** Error **
ERROR in .../node_modules/@storybook/angular/dist/client/preview/index.d.ts
ERROR in .../node_modules/@storybook/angular/dist/client/preview/index.d.ts(2,23):
TS2688: Cannot find type definition file for 'webpack-env'.
To Reproduce Steps to reproduce the behavior:
- Import addParameters into your story
Expected behavior Works…
Code snippets
import { addParameters} from '@storybook/angular';
System:
npx -p @storybook/cli@next sb init --type angular
Additional context I had to install the @next cli, because of a different bug in Angular and Storybook.
Dev Dependencies
"@storybook/addon-actions": "^5.2.0-beta.39",
"@storybook/addon-backgrounds": "^5.1.11",
"@storybook/addon-links": "^5.2.0-beta.39",
"@storybook/addon-notes": "^5.2.0-beta.39",
"@storybook/addons": "^5.2.0-beta.39",
"@storybook/angular": "^5.2.0-beta.39",
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:44 (34 by maintainers)
Top Results From Across the Web
Build:Cannot find type definition file for webpack-env
Go to 'Dependencies' -> right click on 'npm' and click 'Restore Packages enter image description here.
Read more >@types/webpack-env - npm
TypeScript definitions for webpack (module API). ... Start using @types/webpack-env in your project by running `npm i @types/webpack-env`.
Read more >TS2688: Cannot find type definition file for 'webpack'.
I created a new SPA application using React following the instructions at ...
Read more >Cannot find type definition file for 'node' in TypeScript
To solve the error "Cannot find type definition file for node", install the node types by running npm i -D @types/node . If...
Read more >Error TS2688: Cannot find type definition file for 'node'
If am receiving this error when running the vtex link command: Webpack for react@3.x builder finished in 464ms with errors: [at-loader] ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can confirm this.
@VladislavLobakh If you can, use
skipLibCheck: trueas a workaround until this is solved Please let me know if this workaround doesn’t work for you!Edit Another workaround is installing the types for
webpack-env=>npm i -D @types/webpack-envI try to figure out what’s wrong later this week
Example
.storybook/tsconfig.jsonI saw that a lot of packages added webpack env to the types property of tsconfig.json
I was able get rid of it in angular but I’m not sure why it was added in the first place.
If this is a trouble maker we can try to get rid of this again. Or add an explicit dependency on webpack-env in storybook/core