Skip to content
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

runtime prop type of keyof SomeInterface['property'] resolves to Object #11580

Closed
jacekkarczmarczyk opened this issue Aug 10, 2024 · 1 comment · Fixed by #11581
Closed

runtime prop type of keyof SomeInterface['property'] resolves to Object #11580

jacekkarczmarczyk opened this issue Aug 10, 2024 · 1 comment · Fixed by #11581
Labels

Comments

@jacekkarczmarczyk
Copy link
Contributor

jacekkarczmarczyk commented Aug 10, 2024

Vue version

3.4.24

Link to minimal reproduction

https://play.vuejs.org/#eNp9kcFOwzAMhl8lygWQRgcaXKoyCdAOcIAJdiMIhdYt2VInSpyxadq7k6Za4YAm5eDYf/58tnf81tpsHYDnvPClU5aYBwqWaYnNjeDkBZ8KVEjgalkCW2wtsJ1AxioAm/chY7UxOZO47W57gfEIrKBWCHNnrC+SzJlAkLMVbE2djN5OOpOT9/hgenomsBj3DPHHeCForZYE02I8hAL5KEKVBmvVZEtvMJInc8FL01qlwT1bUgYj+EAnuNTafD+mHLkAo0O+/IJy9U9+6TddTvC5Aw9uDYIPNZKuAerLs9cn2MR4KLamCjqqjxRfwBsdOsZedhewith/dIn2obXGkcJm4WcbAvSHpjrQNOekFzyu7/5I67+4k+zqsJ84xY81uM4zDnCSXWcX559AMrvk+x/cJLBV

Steps to reproduce

interface Type {
  deep: {
    foo: any
  }
}

defineProps<{
  route: keyof Type['deep']
}>()

What is expected?

const __sfc__ = /*#__PURE__*/_defineComponent({
  __name: 'App',
  props: {
    route: { type: String, required: true }
  },

What is actually happening?

const __sfc__ = /*#__PURE__*/_defineComponent({
  __name: 'App',
  props: {
    route: { type: Object, required: true }
  },

System Info

No response

Any additional comments?

Last working version: 3.4.23
Possibly related:
5cef52a#diff-8d5ec7c83895d7e238b2db7d7ac5dca5470cfdde52e432d693c390cc52978d15R1643
#11132

Was broken in 3.4.24, since 3.4.27 works fine with the code below

defineProps<{
  route: keyof Type
}>()

but doesn't work with keyof Type['deep']

@LinusBorg
Copy link
Member

LinusBorg commented Aug 10, 2024

Why should it be String? Type['deep'] refers to an object: { foo: any }

Edit: sorry missed the keyof 🤦🏻‍♂️

@jacekkarczmarczyk jacekkarczmarczyk changed the title runtime prop type of keyof SomeInterface resolves to Object runtime prop type of keyof SomeInterface['property'] resolves to Object Aug 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants