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

[Bug]: @storybook/test does not support typescript versions < 4.7 #28883

Closed
joshwooding opened this issue Aug 14, 2024 · 0 comments · Fixed by #28887
Closed

[Bug]: @storybook/test does not support typescript versions < 4.7 #28883

joshwooding opened this issue Aug 14, 2024 · 0 comments · Fixed by #28887
Assignees

Comments

@joshwooding
Copy link
Member

Describe the bug

The line:

type Queries = ReturnType<typeof within<typeof queries>>;

Causes typescript to error

Reproduction link

https://www.typescriptlang.org/play/?ts=4.6.4#code/LAKAZgrgdgxgLgSwPZQAQHcFwBYKgHgCUA+ACgEoAuVQ1Ab1FSdQCcBTOCFtKCAGz6oAhgGdhUAJ4BuUAF9QoGChFxUARwhsWCNmIC89WTJCg4EgA5tUARU3bdqA4Q5coAFQtt8Zy0jAYsXAIfNj91Ox0RYmIpIA

Reproduction steps

  1. Use Typescript 4.6.4
  2. Try to use @storybook/test

System

Storybook Environment Info:

  System:
    OS: Windows 10 10.0.26120
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 22.2.0 - ~\AppData\Local\Temp\xfs-45b0f465\node.CMD
    Yarn: 4.3.0 - ~\AppData\Local\Temp\xfs-45b0f465\yarn.CMD <----- active
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.8)
  npmPackages:
    @storybook/addon-a11y: ^8.2.4 => 8.2.4
    @storybook/addon-actions: ^8.2.4 => 8.2.4
    @storybook/addon-docs: ^8.2.4 => 8.2.4
    @storybook/addon-essentials: ^8.2.4 => 8.2.4
    @storybook/addon-interactions: ^8.2.4 => 8.2.4
    @storybook/addon-links: ^8.2.4 => 8.2.4
    @storybook/addon-mdx-gfm: ^8.2.4 => 8.2.4
    @storybook/addon-storysource: ^8.2.4 => 8.2.4
    @storybook/blocks: ^8.2.4 => 8.2.4
    @storybook/components: ^8.2.4 => 8.2.4
    @storybook/icons: ^1.2.9 => 1.2.9
    @storybook/manager-api: ^8.2.4 => 8.2.4
    @storybook/react: ^8.2.4 => 8.2.4
    @storybook/react-vite: ^8.2.4 => 8.2.9
    @storybook/test: patch:@storybook/test@npm%3A8.2.4#~/.yarn/patches/@storybook-test-npm-8.2.4-0a53c854b7.patch => 8.2.4
    @storybook/theming: ^8.2.4 => 8.2.4
    @storybook/types: ^8.2.4 => 8.2.4
    chromatic: ^11.3.2 => 11.3.2
    msw-storybook-addon: ^1.8.0 => 1.8.0
    storybook: ^8.2.4 => 8.2.4

Additional context

I patched it locally as:

type typeOfWithin = typeof within;
type Queries = ReturnType<typeOfWithin<typeof queries>>;

But that still has issues in the playground...

ndelangen added a commit that referenced this issue Aug 15, 2024
@vanessayuenn vanessayuenn moved this to Empathy Backlog in Core Team Projects Aug 15, 2024
@github-project-automation github-project-automation bot moved this from Empathy Backlog to Done in Core Team Projects Aug 15, 2024
kylegach added a commit that referenced this issue Aug 15, 2024
* next: (27 commits)
  apply fix for #28883
  fixes
  apply linting to scripts
  update snapshots
  cleanup
  remove duplicate comment
  more fixes
  jsdoc linting fixes
  misc fixes
  remove invalid syntax
  remove duplicate comment
  remove duplicate comment
  remove duplicate comment
  remove duplicate comment
  remove duplicate comment
  move comment
  move comment
  remove redundant comment
  fix linting of jsdoc comments example blocks
  fix snapshots
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants