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

Typings issue when custom version of history package is in dependencies #11928

Closed
ajkl2533 opened this issue Aug 12, 2020 · 8 comments
Closed

Comments

@ajkl2533
Copy link
Contributor

Describe the bug
When a custom version of history package is present in package.json dependencies and in tsconfig.json is configured to not skip library checks (skipLibCheck: false), then type check script (tsc --noEmit) is failing with:

##[error]node_modules/@types/reach__router/index.d.ts(13,33): error TS2305: Module '"../../history"' has no exported member 'LocationState'.
##[error]node_modules/@types/reach__router/index.d.ts(14,80): error TS2344: Type 'S' does not satisfy the constraint 'object'.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/ajkl2533/storybook-repros/tree/history-types-issue
  2. yarn install
  3. yarn run types
  4. See error

Expected behavior
Type check should end without error

System:
System:
OS: macOS 10.15.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - ~/.nvm/versions/node/v12.13.1/bin/npm
Browsers:
Chrome: 84.0.4147.125
Safari: 13.1.2
npmPackages:
@storybook/addon-actions: ^6.0.3 => 6.0.4
@storybook/addon-essentials: ^6.0.3 => 6.0.4
@storybook/addon-links: ^6.0.3 => 6.0.4
@storybook/node-logger: ^6.0.3 => 6.0.4
@storybook/preset-create-react-app: ^3.1.4 => 3.1.4
@storybook/react: ^6.0.3 => 6.0.4

@stale
Copy link

stale bot commented Sep 2, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Sep 2, 2020
@parkjh
Copy link

parkjh commented Sep 22, 2020

@ajkl2533 yea we are getting the same issue too...

@stale stale bot removed the inactive label Sep 22, 2020
@parkjh
Copy link

parkjh commented Sep 22, 2020

are there any workaround for this yet?

@antoniosZ
Copy link

same issue

@Fredx87
Copy link
Contributor

Fredx87 commented Jan 22, 2021

This is actually a bug of the @types/reach__router package, that incorrectly depends on the @types/history package. The latest version solves this issue, I made a PR to fix this.

@shilman
Copy link
Member

shilman commented Jan 22, 2021

Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.18 containing PR #13703 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jan 22, 2021
@shilman
Copy link
Member

shilman commented Jan 22, 2021

Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.15 containing PR #13703 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

@antoniosZ
Copy link

@shilman I still get the same issue when trying to use history v5.

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

No branches or pull requests

5 participants