You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If I run the TypeScript compiler to review the errors in my project, it reports errors from:
@storybook/addons
@storybook/client-api
@types/reach__router
The last one is used by @storybook/router as mentioned in #8095. By using what is suggested in that issue, I can remove only one of the seventeen errors. I started with a clean build of React Native and I have no problems. Once I install the clean build of Storybook, I get the errors.
I was able to remove the errors caused by lodash by installing its type definitions:
npm i -D @types/lodash@4.14.160
Then go to your package.json and remove the ~ or ^ in front of the version:
"@types/lodash": "4.14.160"
If you install the latest version of the type definitions you will encounter the following error:
node_modules/@storybook/client-api/dist/story_store.d.ts:50:42 - error TS7016: Could not find a declaration file for module 'lodash'. '/Users/tsetso/git/howthrive/HowThriveApp/node_modules/lodash/lodash.js' implicitly has an 'any' type.
Try `npm install @types/lodash` if it exists or add a new declaration (.d.ts) file containing `declare module 'lodash';`
50 pushToManager: (() => void) & import("lodash").Cancelable;
That's why you must explicitly forbid any possible updates to this package (even minor ones usually cause breaking changes in type definitions).
To remove the error caused by the missing Window object, create a index.d.ts file if you don't already have one and add this:
Describe the bug
If I run the TypeScript compiler to review the errors in my project, it reports errors from:
@storybook/addons
@storybook/client-api
@types/reach__router
The last one is used by
@storybook/router
as mentioned in #8095. By using what is suggested in that issue, I can remove only one of the seventeen errors. I started with a clean build of React Native and I have no problems. Once I install the clean build of Storybook, I get the errors.To Reproduce
npx react-native init AwesomeTSProject --template react-native-template-typescript --npm
cd AwesomeTSProject/
npx -p @storybook/cli sb init --use-npm --type react_native
npx tsc
Expected behavior
I expect the TypeScript compiler to not throw any errors.
Command Line Output
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
Node: 11.12.0 - ~/.nvm/versions/node/v11.12.0/bin/node
Yarn: 1.17.3 - ~/.yarn/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v11.12.0/bin/npm
Browsers:
Chrome: 81.0.4044.122
Firefox: 70.0.1
Safari: 13.1
npmPackages:
@storybook/addon-actions: ^5.3.18 => 5.3.18
@storybook/addon-knobs: ^5.3.18 => 5.3.18
@storybook/addon-ondevice-actions: ^5.3.18 => 5.3.18
@storybook/addon-ondevice-knobs: ^5.3.18 => 5.3.18
@storybook/addons: ^5.3.18 => 5.3.18
@storybook/react-native: ^5.3.18 => 5.3.18
The text was updated successfully, but these errors were encountered: