TS2590: Expression produces a union type that is too complex to represent - (TS v5.0)
@weswigham がすでに取り組んでいます。
2023年1月30日 から。
評価
この issue はまだ評価されていません。
説明
🔎 Search Terms
TS2590: Expression produces a union type that is too complex to represent
🕗 Version & Regression Information
- This changed between versions 4.9.4 and 5.0.0-dev.20230125
💻 Code
Simplified Version
import { Button } from "@chakra-ui/react"
export const CustomButtonCell = (): JSX.Element => {
return (
<Button
gap={3}
p={4}
h={"initial"}
textAlign={"left"}
fontWeight={"initial"}
rounded={"xl"}
/>
)
}
Actual Version
import { Button } from "@chakra-ui/react"
import { ComponentProps } from "react"
export interface CustomButtonCellProps extends ComponentProps<typeof Button> {
highlighted?: boolean
transparent?: boolean
}
export const CustomButtonCell = ({
highlighted,
transparent,
...rest
}: CustomButtonCellProps): JSX.Element => {
const colorScheme = transparent
? "transparent"
: highlighted
? "tertiary"
: "neutrals"
return (
<Button
gap={3}
p={4}
h={"initial"}
textAlign={"left"}
fontWeight={"initial"}
colorScheme={colorScheme}
rounded={"xl"}
{...rest}
/>
)
}
🙁 Actual behavior
On both of the versions, typescript throws similar error:
ERROR in ./src/ui/components/CustomButtonCell.tsx:4:18
TS2590: Expression produces a union type that is too complex to represent.
2 | import { ComponentProps } from "react"
3 |
> 4 | export interface CustomButtonCellProps extends ComponentProps<typeof Button> {
| ^^^^^^^^^^^^^^^^^^^^^
5 | highlighted?: boolean
6 | transparent?: boolean
7 | }
🙂 Expected behavior
This is a very simple JSX.Element. It worked fine with typescript 4.9.4 but our project needed the latest moduleResolution: "bundler" support for some of the dependencies.
External Dependencies
"@chakra-ui/react": 2.9.4 - also tried 2.7.4
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TypeScript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/TypeScript#64322 · コメント 2 件 · リアクション 1 件 · 担当者 2 名 ·
-
Possible Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/TypeScript#64278 · コメント 1 件 · リアクション 1 件 ·
-
Docs
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
microsoft/TypeScript#64118 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/TypeScript#64094 ·
-
Docs
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/TypeScript#63959 · コメント 5 件 ·
microsoft/TypeScript の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
milvus-io/birdwatcher#545 ·
-
kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
kubernetes-sigs/prow#953 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
caddyserver/caddy#8046 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
jaegertracing/jaeger#9588 ·