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 React renderer fails to compile with Typescript <5 #23554

Closed
j-m opened this issue Jul 21, 2023 · 0 comments · Fixed by #23574
Closed

[Bug]: Storybook React renderer fails to compile with Typescript <5 #23554

j-m opened this issue Jul 21, 2023 · 0 comments · Fixed by #23574

Comments

@j-m
Copy link

j-m commented Jul 21, 2023

Describe the bug

Hi there!

I just upgraded to Storybook 7 and hit the error:

node_modules/@storybook/react/node_modules/type-fest/source/camel-case.d.ts:25:32 - error TS1005: '?' expected.
25 infer FirstWord extends string,
~
node_modules/@storybook/react/node_modules/type-fest/source/camel-case.d.ts:26:42 - error TS1005: '?' expected.
26 ...infer RemainingWords extends string[],
~
node_modules/@storybook/react/node_modules/type-fest/source/join.d.ts:59:36 - error TS1005: '?' expected.
59 infer First extends JoinableItem,
~
node_modules/@storybook/react/node_modules/type-fest/source/join.d.ts:60:49 - error TS1005: '?' expected.
60 ...infer Tail extends readonly JoinableItem[],
~
node_modules/@storybook/react/node_modules/type-fest/source/join.d.ts:64:50 - error TS1005: '?' expected.
64 ...infer Head extends readonly JoinableItem[],
~
node_modules/@storybook/react/node_modules/type-fest/source/join.d.ts:65:36 - error TS1005: '?' expected.
65 infer Last extends JoinableItem,
~
Found 6 errors.

Your package.json suggests you support any version of typescript

"type-fest": "^3.11.0",

but type-fest

Requires TypeScript >=5.1

I can't use Typescript 5 yet, could you pin Typescript to ^5 so people know older versions of typescript won't work, please?

I have skipLibCheck: true so tbh I'm not sure why it's even bothering to check.

To Reproduce

I'm on typescipt: ~4.5, and am using React and vite.
Default everything.
Run tsc (i.e. npm run compile in the repro).

https://stackblitz.com/edit/github-9ggjcp?file=tsconfig.json

System

Environment Info:

  System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 114.0.5735.199
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.82)
  npmPackages:
    @storybook/addon-essentials: ^7.1.0 => 7.1.0
    @storybook/addon-interactions: ^7.1.0 => 7.1.0
    @storybook/addon-links: ^7.1.0 => 7.1.0
    @storybook/blocks: ^7.1.0 => 7.1.0
    @storybook/react: ^7.1.0 => 7.1.0
    @storybook/react-vite: ^7.1.0 => 7.1.0
    @storybook/testing-library: ^0.2.0 => 0.2.0

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
4 participants