Subscribe on changes!

Wrong type with 'defineProps' and 'withDefaults' (Typescript 5.1.3)

avatar
Jun 13th 2023

Vue version

3.3

Link to minimal reproduction

https://stackoverflow.com/questions/76322580/after-update-of-vue-3-withdefaults-throws-a-typescript-error

Steps to reproduce

Try to use 'defineProps' and 'withDefaults'. I got the same issue as a guy from the stackoverlfow. image

What is expected?

I was expecting that everything will work like here image

What is actually happening?

TypeError image

System Info

System:                                                       
    OS: Windows 10 10.0.19045                                   
    CPU: (6) x64 AMD Ryzen 5 3500X 6-Core Processor             
    Memory: 18.20 GB / 31.92 GB                                 
  Binaries:                                                     
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.43)
    Internet Explorer: 11.0.19041.1566

Any additional comments?

No response

avatar
Jun 14th 2023

It seems not compatible with TS 5.1.3. see also https://twitter.com/johnsoncodehk/status/1665386381575593986

avatar
Jun 22nd 2023

Could you please try it again with upgrading VScode extension Volar, TS, and Vue to the latest version? If the problem stills, please provide a minimum reproduction.