Describe the bug
This is a common hack to use a comma to declare generics without default or extends in TSX file. It's seems that some part of the build chain (in dev mode) drop the comma, making the file invalid.

Reproduction
https://github.com/ArnaudBarre/vite-generic-bug
Equivalent to yarn create @vitejs/app --template react-ts + update main.tsx to:
const App = <T,>(props: {value: T}) => {
return <div>Hello {typeof props.value}</div>
}
ReactDOM.render(
<React.StrictMode>
<App value="string" />
</React.StrictMode>,
document.getElementById('root')
)
System Info
vite version: 2.0.4 (esbuild 0.8.53)
- Operating System: Mac
- Node version: 14.13.1
- Package manager: yarn 1.22.10
Describe the bug
This is a common hack to use a comma to declare generics without default or extends in TSX file. It's seems that some part of the build chain (in dev mode) drop the comma, making the file invalid.
Reproduction
https://github.com/ArnaudBarre/vite-generic-bug
Equivalent to
yarn create @vitejs/app --template react-ts+ updatemain.tsxto:System Info
viteversion: 2.0.4 (esbuild 0.8.53)