naive-ui
naive-ui copied to clipboard
Failed to resolve index type into finite keys
TuSimple/naive-ui version (版本)
2.34.4
Vue version (Vue 版本)
3.3.4
Browser and its version (浏览器及其版本)
chrome118
System and its version (系统及其版本)
window
Node version (Node 版本)
Reappearance link (重现链接)
https://codesandbox.io/s/u6w4gh
Reappearance steps (重现步骤)
Failed to resolve index type into finite keys
Expected results (期望的结果)
<script setup lang="ts">
import type { InputNumberProps } from 'naive-ui';
const { componentProps } = defineProps<InputNumberProps>();
const slots = useSlots();
</script>
[vite] Internal server error: [@vue/compiler-sfc] Failed to resolve index type into finite keys
E://node_modules/naive-ui/es/_utils/naive/extract-public-props.d.ts
3 | type themePropKeys = keyof typeof useTheme.props;
4 | type RemoveReadonly<T> = {
5 | -readonly [key in keyof T]: T[key];
| ^^^^^^^
6 | };
7 | export type ExtractPublicPropTypes<T> = Omit<Partial<RemoveReadonly<ExtractPropTypes<T>>>, Exclude<themePropKeys, 'themeOverrides'> | Extract<keyof T, `internal${string}`>>;
Actual results (实际的结果)
Fix this error, otherwise Support imported types in SFC macros seems pointless
Remarks (补充说明)
Whether should support https://github.com/vuejs/core/pull/8083
Have the same problem