Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@vue/compiler-sfc] Failed to resolve index type into finite keys #9111

Closed
laterdayi opened this issue Sep 1, 2023 · 8 comments
Closed

[@vue/compiler-sfc] Failed to resolve index type into finite keys #9111

laterdayi opened this issue Sep 1, 2023 · 8 comments

Comments

@laterdayi
Copy link

laterdayi commented Sep 1, 2023

Vue version

lastest

Link to minimal reproduction

Steps to reproduce

<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:/projects/stp-web/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}`>>; 

What is expected?

Fix this error, otherwise Support imported types in SFC macros seems pointless

What is actually happening?

[@vue/compiler-sfc] Failed to resolve index type into finite keys #9111

System Info

window

Any additional comments?

No response

@edison1105
Copy link
Member

It is not supported native-ui yet.
use /@vue-ignore/ to skip it.

@laterdayi
Copy link
Author

Should this be handled by vue or naiveUI?
@edison1105

@laterdayi
Copy link
Author

<script setup lang="ts">
import type { InputNumberProps } from 'naive-ui';
const { componentProps } = defineProps<InputNumberProps>();
const slots = useSlots();
</script>

@edison1105 Where should I set /@vue-ignore/

@sxzz
Copy link
Member

sxzz commented Sep 1, 2023

Duplicate of #8286

See #8286 (comment) #8286 (comment)

@sxzz sxzz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
@laterdayi
Copy link
Author

Duplicate of #8266

See #8286 (comment) #8286 (comment)

Does this mean that v3.3 still cannot use external props?

@sxzz
Copy link
Member

sxzz commented Sep 1, 2023

It's not a yes or no question. Please read the two comments I provided. I believe they have explained it in enough detail.

@laterdayi
Copy link
Author

laterdayi commented Sep 1, 2023

Where should I set /@vue-ignore/

<script setup lang="ts">
import type { InputNumberProps } from 'naive-ui';
Where should I set /@vue-ignore/
const { componentProps } = defineProps<InputNumberProps>();
const slots = useSlots();
</script>

@sxzz Thank you for your help. I have already read it, but I set /@vue-ignore/, it will still report an error

@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants