We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
defineComponent
3.5.0-alpha.1
https://play.vuejs.org/#eNp9UstOAzEM/BUrl7ZSSUHApRQkqDjAARDlGAmttm4J7DpR4i2Vqv13nKz6EK9LZI8njmecjbr2Xq8aVGM1iWWwniEiNx6qgpaXRnE06sqQrb0LDBuY48ISTp3khMRDWCJPmxAkvqPIBZUILSyCq6EnbXsXhgz95PQHuvB+6ohxzSnU5bZlvzdz9f6F3vD7m/2NIQAfnI9jyDEAW65wDDMOlpYJaofpzFL6mTrYUnOm84UOCEIKBJs23zPUDgaGJqPODdEuCWPtq4JRMoDJ3K5yAPCCkTM06rDJ6ICphuJe6Whhl/o9OhKL8whGJa22wvDo2ToSh3c6jCqqyn3eZ4xDg1lGvvOG5ccv+HtcJ8yop4ARwwqN2tW4CGJ9V76dPYjVB8XazRux4L/iM0ZXNWnGjnbT0FzGPuDlae/y5xDjX+LtmpHiVlQadL8Mo+RDpC3+JX0/7qk+2y5DXHxdYUg9xcBTfa6Pj4rKvxX6RLVf3d/siw==
import { createApp } from 'vue'; const app = createApp() app.component('SomeComponent', defineComponent({ props: { title: String }, setup(props) { // @ts-expect-error const a: number = props.title const b: string = props.title return {} } }))
The type of props is incorrectly typed as LooseRequired<Readonly<ExtractPropTypes<{}>> & {}>.
LooseRequired<Readonly<ExtractPropTypes<{}>> & {}>
Simply moving the component out of the app.component call makes the types resolve correctly.
app.component
I expect the types to be resolved as:
LooseRequired<Readonly<{ title: string; } & {} & {}> & {}>
No response
This is likely the same or similar cause as #10842 and #10841 but thought I would raise separately as it expresses itself somewhat differently.
Originally uncovered in nuxt/nuxt#27001 - see https://github.com/nuxt/nuxt/actions/runs/8893792664/job/24420717065?pr=27001.
The text was updated successfully, but these errors were encountered:
fix(types): fix app.component() typing with inline defineComponent
908f70a
close #10843
closed via 908f70a
Sorry, something went wrong.
No branches or pull requests
Vue version
3.5.0-alpha.1
Link to minimal reproduction
https://play.vuejs.org/#eNp9UstOAzEM/BUrl7ZSSUHApRQkqDjAARDlGAmttm4J7DpR4i2Vqv13nKz6EK9LZI8njmecjbr2Xq8aVGM1iWWwniEiNx6qgpaXRnE06sqQrb0LDBuY48ISTp3khMRDWCJPmxAkvqPIBZUILSyCq6EnbXsXhgz95PQHuvB+6ohxzSnU5bZlvzdz9f6F3vD7m/2NIQAfnI9jyDEAW65wDDMOlpYJaofpzFL6mTrYUnOm84UOCEIKBJs23zPUDgaGJqPODdEuCWPtq4JRMoDJ3K5yAPCCkTM06rDJ6ICphuJe6Whhl/o9OhKL8whGJa22wvDo2ToSh3c6jCqqyn3eZ4xDg1lGvvOG5ccv+HtcJ8yop4ARwwqN2tW4CGJ9V76dPYjVB8XazRux4L/iM0ZXNWnGjnbT0FzGPuDlae/y5xDjX+LtmpHiVlQadL8Mo+RDpC3+JX0/7qk+2y5DXHxdYUg9xcBTfa6Pj4rKvxX6RLVf3d/siw==
Steps to reproduce
The type of props is incorrectly typed as
LooseRequired<Readonly<ExtractPropTypes<{}>> & {}>
.Simply moving the component out of the
app.component
call makes the types resolve correctly.What is expected?
I expect the types to be resolved as:
What is actually happening?
The type of props is incorrectly typed as
LooseRequired<Readonly<ExtractPropTypes<{}>> & {}>
.System Info
No response
Any additional comments?
This is likely the same or similar cause as #10842 and #10841 but thought I would raise separately as it expresses itself somewhat differently.
Originally uncovered in nuxt/nuxt#27001 - see https://github.com/nuxt/nuxt/actions/runs/8893792664/job/24420717065?pr=27001.
The text was updated successfully, but these errors were encountered: