chatgpt-web icon indicating copy to clipboard operation
chatgpt-web copied to clipboard

在linux和widdows下编译都报错,前几天倒是OK的

Open sl514 opened this issue 1 year ago • 5 comments

transforming (2058) node_modules\naive-ui\es\dropdown\src\DropdownOption.jssrc/components/common/SvgIcon/index.vue:20:9 - error TS2322: Type 'string | undefined' is not assignable to type 'string | IconifyIcon'. Type 'undefined' is not assignable to type 'string | IconifyIcon'.

20 <Icon :icon="icon" v-bind="bindAttrs" /> ~~~~~

node_modules/@iconify/vue/dist/iconify.d.ts:259:5 259 icon: IconifyIcon | string; ~~~~ The expected type comes from property 'icon' which is declared here on type 'ComponentProps<DefineComponent<IconProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<...>, {}>>'

Found 1 error in src/components/common/SvgIcon/index.vue:20

transforming (2115) node_modules\naive-ui\es_utils\dom\is-document.jsERROR: "type-check" exited with 2.

sl514 avatar Apr 10 '23 13:04 sl514

我也是这个问题

zy84338719 avatar Apr 10 '23 19:04 zy84338719

这是由不兼容的类型分配引起的 TypeScript 编译错误。错误消息表明类型为“string |”的变量undefined'被分配给'string |类型的变量IconifyIcon',这是不允许的。该问题出现在文件“DropdownOption.jssrc/components/common/SvgIcon/index.vue”的第 20 行。此外,文件“is-document.js”中还有另一个错误似乎与第一个错误无关.

rhymed-l avatar Apr 11 '23 01:04 rhymed-l

改为这个就行了,刚问的chatgpt,哈哈哈

<Icon :icon="icon as string" v-bind="bindAttrs" />

yhw17 avatar Apr 11 '23 18:04 yhw17

改为这个就行了,刚问的chatgpt,哈哈哈

<Icon :icon="icon as string" v-bind="bindAttrs" />

我也是遇到这个问题了,方案亲测可用

aquarkgn avatar Apr 15 '23 11:04 aquarkgn

找到项目目录:执行 vim -r src/components/common/SvgIcon/index.vue 将 :icon="icon" 替换为 :icon="icon as string"

jagguo avatar Apr 23 '23 03:04 jagguo

This issue is stale because it has been open for 10 days with no activity.

github-actions[bot] avatar Aug 29 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 2 days since being marked as stale.

github-actions[bot] avatar Sep 01 '23 01:09 github-actions[bot]