Skip to content

Prop required and starts with on's type is broken in ts 4.7 #6052

@07akioni

Description

@07akioni

Vue version

3.2.36

Link to minimal reproduction

nope

Steps to reproduce

index.ts

import { defineComponent } from "vue";

defineComponent({
  props: {
    onX: {
      type: Function,
      required: true,
    },
  },
  setup(props) {
    props.onX();
  },
});

package.json

{
  "name": "vue-ts",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "tsc index.ts --moduleResolution node --strict --noEmit --lib ESNext,DOM"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/types": "^7.18.4",
    "typescript": "^4.7.2",
    "vue": "^3.2.36"
  }
}

Run npm run build

What is expected?

No error

What is actually happening?

image

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions