Closed jmeyers91 closed 1 year ago
Can confirm this issue.
can @types/react be an optional dependency instead?
A simple reproduction from a real project: https://github.com/euaaaio/repro-storybook-vue-volar-jsx
+1 I've got the same issue!
Using vite/client
as types in tsconfig.json helped me.
https://github.com/johnsoncodehk/volar/issues/552#issuecomment-934166166
{
"compilerOptions": {
"target": "esnext",
...
"lib": [
"esnext",
"dom"
],
"types": [
"vite/client"
]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue"
]
}
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!
Hi, can anyone confirm if this is still an issue in the latest version of @storybook/builder-vite
?
I believe this is now fixed in the latest storybook 7.0 versions. I'm going to close this out to try to keep things organized, but let me know if you're still having trouble and we can re-open.
This issue has reappeared since version 7.2
···
Error: ../../node_modules/.pnpm/vue@3.4.19_typescript@5.3.3/node_modules/vue/jsx.d.ts(8,22): error TS2320: Interface 'Element' cannot simultaneously extend types 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' and 'ReactElement<any, any>'.
Named property 'key' of types 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' and 'ReactElement<any, any>' are not identical.
Error: ../../node_modules/.pnpm/vue@3.4.19_typescript@5.3.3/node_modules/vue/jsx.d.ts(8,22): error TS2320: Interface 'Element' cannot simultaneously extend types 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' and 'ReactElement<any, any>'.
Named property 'props' of types 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' and 'ReactElement<any, any>' are not identical.
Error: ../../node_modules/.pnpm/vue@3.4.19_typescript@5.3.3/node_modules/vue/jsx.d.ts(8,22): error TS2320: Interface 'Element' cannot simultaneously extend types 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' and 'ReactElement<any, any>'.
Named property 'type' of types 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' and 'ReactElement<any, any>' are not identical.
Error: ../../node_modules/.pnpm/vue@3.4.19_typescript@5.3.3/node_modules/vue/jsx.d.ts(15,22): error TS2430: Interface 'IntrinsicElements' incorrectly extends interface 'NativeElements'.
Types of property 'a' are incompatible.
Type 'DetailedHTMLProps<AnchorHTMLAttributes
Describe the bug After installing Storybook in a Vue3 Vite project, the project no longer builds due to JSX type conflicts. After installing storybook using the recommended command, the
npm run build
script produces these errors:To Reproduce
My reproduction repo is here: https://github.com/jmeyers91/vue3-ts-storybook-error Clone it and run
npm install; npm run build
to reproduce. You can also re-create the repo and reproduce the error by running these commands:System