Skip to content

Getting error then importing type InputProps after update to v3.1 #3973

@Artemiy111

Description

@Artemiy111

Environment

Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.1

Reproduction

https://codesandbox.io/p/devbox/stoic-mopsa-t44pzq

<script setup lang="ts">
import type { InputProps, InputEmits } from '@nuxt/ui'
import { EyeIcon, EyeOffIcon } from 'lucide-vue-next'

const props = defineProps<Omit<InputProps, 'type'>>()
const emit = defineEmits<InputEmits>()
const model = defineModel<string>()
const show = defineModel<boolean>('show', { default: false })
</script>

<template>
  <UInput
    v-bind="props"
    v-model="model"
    :type="show ? 'text' : 'password'"
    @blur="emit('blur', $event)"
    @change="emit('change', $event)"
  >
    <template #trailing>
      <button
        type="button"
        :aria-label="show ? 'Спрятать Текст' : 'Показать текст'"
        :aria-pressed="show"
        @click="show = !show"
      >
        <EyeOffIcon
          v-if="show"
          :size="20"
        />
        <EyeIcon
          v-else
          :size="20"
        />
      </button>
    </template>
  </UInput>
</template>

Description

It was working as intended before update.

Additional context

No response

Logs

ERROR  Internal server error: [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type  
                          21:50:46

D:/projects/biplane-shop/app/src/shared/ui/kit/input-password/InputPassword.vue
3  |  import { EyeIcon, EyeOffIcon } from 'lucide-vue-next'
4  |
5  |  const props = defineProps<Omit<InputProps, 'type'>>()
   |                                 ^^^^^^^^^^
6  |  const emit = defineEmits<InputEmits>()
7  |  const model = defineModel<string>()
  Plugin: vite:vue
  File: D:/projects/biplane-shop/app/src/shared/ui/kit/input-password/InputPassword.vue
      at ScriptCompileContext.error (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:19741:11)
      at innerResolveTypeElements (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22104:20)
      at resolveTypeElements (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:21995:20)
      at resolveBuiltin (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22399:13)  
      at innerResolveTypeElements (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:22086:20)
      at resolveTypeElements (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:21995:20)
      at resolveRuntimePropsFromType (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:23632:20)
      at extractRuntimeProps (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:23608:17)
      at genRuntimeProps (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:23596:18) 
      at Object.compileScript (D:\projects\biplane-shop\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:24709:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamv3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions