-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Per-file jsx paragma got TS2322: Type 'Element' is not assignable to type 'VNode'. #23457
Comments
can not reproduce this locally. can you share a self-contained repro project: c:\test\23457>type package.json
{
"private": true,
"dependencies": {
"vue": "^2.5.16"
}
}
c:\test\23457>type tsconfig.json
{
"compilerOptions": {
"target": "es5",
"jsx": "react"
}
}
c:\test\23457>type a.tsx
// index.vue.tsx
/** @jsx h */
import Vue, { CreateElement, VNode } from 'vue';
export default class VuePreview extends Vue {
render(h: CreateElement): VNode {
return <div>VuePreview</div>;
}
}
c:\test\23457>tsc --v
Version 2.9.0-dev.20180414
c:\test\23457>tsc
c:\test\23457>echo %ERRORLEVEL%
0 |
https://github.com/TotooriaHyperion/tsc-vue-jsx-bug got different error src/index.tsx(6,27): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. when using with react: index.react.tsx is fine Obviously, |
Issue #13260 tracks adding needed support in TS to support vue and jsx. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Me too, but should work on pure Javascript too/not only .tsx files
gives essentially the same
plus 2 times
|
TypeScript Version: 2.9.0-dev.20180414
Search Terms:
TS2322: Type 'Element' is not assignable to type 'VNode'.
Property 'isRootInsert' is missing in type 'Element'.
Code
can be reproduced at typescript@2.9.0-dev.20180414
Expected behavior:
compiled without error
Actual behavior:
Per-file JSX factories @jsx
successfully compiled this file to index.vue.js ⬇️
but type check got the error
TS2322: Type 'Element' is not assignable to type 'VNode'.
Property 'isRootInsert' is missing in type 'Element'.
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: