JSX element type does not have any construct or call signatures.ts(2604)
See original GitHub issueThis happens when using vue-class-component. Here is an example snippet. (Taken from https://class-component.vuejs.org/guide/class-component.html#other-options and converted to TS)
<template>
<OtherComponent />
</template>
<script lang="ts">
import Vue from 'vue'
import Component from 'vue-class-component'
import OtherComponent from './OtherComponent.vue'
@Component({
components: {
OtherComponent
}
})
export default class HelloWorld extends Vue {}
</script>
This happens because https://github.com/johnsoncodehk/volar/tree/master/packages/vue-language-service does not support vue-class-component syntax, so volar can’t understand where the component definition is coming from.
I believe vue-class-component is still officially supported by Vue team, so we should have support for it in Volar as well.
Issue Analytics
- State:
- Created a year ago
- Reactions:23
- Comments:46 (13 by maintainers)
Top Results From Across the Web
JSX element type Elem does not have any construct or call ...
Simply speaking, the type React.Component<any, any> used is the wrong type which remains unresolved. I used React.FunctionComponent and it worked for me.
Read more >JSX element type does not have any construct or call signatures
The error "JSX element type does not have any construct or call signatures" occurs when we try to pass an element or a...
Read more >JSX element type does not have any construct or call ... - GitHub
Actual behavior: TS2604: JSX element type 'Comp' does not have any construct or call signatures.
Read more >jsx element type 'component' does not have any construct or ...
JSX element type 'Component' does not have any construct or call signatures. [2604] That's because, in the RouteProps interface, the component is defined...
Read more >JSX element type X does not have any construct or call ...
Type the styled component as React.Component to solve this error in Material UI with React and TypeScript.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Reverting to version
0.36.1
looks safe.@zlotnika You can define global component type by
GlobalComponents
interface for vue-router and project components, see https://github.com/johnsoncodehk/volar/tree/master/extensions/vscode-vue-language-features#usage.Or in v0.37.1, you can config
experimentalSuppressUnknownJsxPropertyErrorsexperimentalSuppressInvalidJsxElementTypeErrors = true
to ignore unknown component type errors.