Skip to content

Type inference error with SketchPicker when using pnpm build due to dependency on internal type 'colorModel' #278

@chip-cmyk

Description

@chip-cmyk

Description​​

When building a Vue 3 + TypeScript project with pnpm build, the SketchPicker component from vue-color causes TypeScript to throw the following error:

Image

src/components/ColorPicker/ColorPicker.vue:314:1 - error TS2742: The inferred type of 'default' cannot be named without a reference to '../../../node_modules/vue-color/dist/types/composable/colorModel'. This is likely not portable. A type annotation is necessary.

314 export default (await import('vue')).defineComponent({
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315 setup() {
    ~~~~~~~~~
...
322 __typeEl: {} as __VLS_TemplateResult['rootEl'],
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
323 });
    ~~~

Code

<template>
...
     <SketchPicker ref="_ref" v-model="currentColor" @update:modelValue="handleColorChange" />
...
<template>

<script setup lang="ts">
import { SketchPicker } from 'vue-color' 
...
</script>

Environment​​

vue-color: 3.0.1
vue: 3.5.13
TypeScript: 5.8.0
Package manager: pnpm@10.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang: typescriptTypeScript-specific typing or tooling problems.status: resolvedThe issue has been resolved or a fix is confirmed.type: supportSupport questions related to usage, configuration, or integration.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions