Subscribe on changes!

DefineProps import issue in v3.3.4

avatar
Jun 8th 2023

Vue version

3.3.4

Link to minimal reproduction

https://github.com/aravindhn94/vuetify_sample

Steps to reproduce

npm install npm run dev

What is expected?

No error during runtime.

I am trying to create a wrapper component over VTextField of vuetify. Adding few more props along with the props of VTextField. So naturally did intersection of two prop types. but this codeblock is causing issues during runtime:

const props = defineProps<
  {
    modelValue: TValue;
    parser: (value: TFormattedValue) => TValue;
    formatter: (value: TValue) => TFormattedValue;
  } & Partial<ExtractPropTypes<VTextField>>
>();

What is actually happening?

[plugin:vite:vue] [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type

Screenshot 2023-06-08 at 4 09 38 PM Screenshot 2023-06-08 at 4 09 22 PM

Getting above runtime error.

System Info

System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M2 Pro
    Memory: 292.56 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.16.0 - /usr/local/bin/node
    npm: 9.5.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 114.0.5735.106
    Safari: 16.1
  npmPackages:
    vue: ^3.3.4 => 3.3.4

Any additional comments?

No response

avatar
Jun 9th 2023
interface Props extends /* @vue-ignore */ Partial<ExtractPropTypes<VTextField>> {
  modelValue: TValue;
  parser: (value: TFormattedValue) => TValue;
  formatter: (value: TValue) => TFormattedValue;
}

defineProps<Props>();
avatar
Jul 10th 2023

Hi. I have same issue. I think Vue 3.3.4 does not support right now. And does not work vue-ignore. who have solution? Thanks. Screenshot 2023-07-10 at 18 43 30

Screenshot 2023-07-10 at 18 44 40 Screenshot 2023-07-10 at 18 43 50
avatar
Jul 14th 2023

@SuleymanQ this should work:

declare const ConfigDefaults: { 
  colors: ColorDefaults
}

export type ConfigProps = typeof ConfigDefaults
const props = defineProps<Partial<ConfigProps>>()
avatar
Jul 17th 2023

It worked. Thanks @edison1105