Subscribe on changes!

Props defined based on imported interface, generates its type as null instead of Object

avatar
Aug 22nd 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9Us1uwyAMfhWLyzaphXuUVqqmHXraHoBLmjgtVfgRkFZTlXefgSzdtJ8Lwtj+fmxubOccv4zIKlaH1isXIWAc3VYapZ31EZ6tdtB7q0EyLlKU6iWTphalg2opiKjd0ESkCKBOdds6l9NDLZYsW7ECvNaN4+dgDVHfUo+cE0GyCvJLestcFV1OMbpQCRH6Ngk4B279UdCN+9FEpZFj0OuDt9eAnoCTQoBJmokoP2V/sTk05riRLNEtloWAfQ97mK2/XNDE4j2+OwzQqwFXcESDnrx04Lx1OQUqkEQzDkOindtvM8BUIB64yCgP2ezCNQbqNhF937QIVxVPyvxOlDleD2dsY2ZZmnbGxhP6wpYnp7oKzKgP6Ml/4buXvxFYKHWYWqqiM8UNIc1A1TfYBaa1JsSsJ8AGOuyVwQxY53P7+PT/x0hjTptNG7Fmpq3Fz1+SZ8U7HgMt7S7+L5Ns+gDiTvl6

Steps to reproduce

  1. Open the SFC playground
  2. Look at the Comp.vue's generated JS
  3. Check the props type

What is expected?

event type should be Object just like anotherEvent.

What is actually happening?

event type is null

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
    Memory: 2.35 GB / 15.57 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 101.0.4951.64
  npmPackages:
    vue: ^3.2.37 => 3.2.37


### Any additional comments?

I want to extract props types from TS to JS.
avatar
Aug 22nd 2022

duplicate of #4294