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

Error when generating the declaration files using vue-tsc "TS4060: Return type of exported function has or is using private name 'ctx'." #2581

Closed
HundredBeans opened this issue Apr 4, 2023 · 0 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@HundredBeans
Copy link

Information

  • vue-tsc version: 1.3.11
  • node version: v18.13.0
  • OS: Windows 10
  • Volar version: v1.2.0

Issue

I want to generate declaration files for a vue library using vue-tsc with this command: vue-tsc --declaration --emitDeclarationOnly it shows these errors

src/__VLS_types.ts:78:119 - error TS4060: Return type of exported function has or is using private name 'ctx'.

78   ? (props: Props, ctx?: { attrs?: any, expose?: any, slots?: Slots, emit?: Emit }) => JSX.Element & { __ctx?: typeof ctx, __props?: typeof props }
                                                                                                                         ~~~

src/__VLS_types.ts:78:141 - error TS4060: Return type of exported function has or is using private name 'props'.

78   ? (props: Props, ctx?: { attrs?: any, expose?: any, slots?: Slots, emit?: Emit }) => JSX.Element & { __ctx?: typeof ctx, __props?: typeof props }
                                                                                                                                               ~~~~~


Found 2 errors.

It was fine when I use version 1.3.2 of the vue-tsc

Replication Steps

You can replicate this issue using this vue-tsc-component-library-example repository. Just update the vue-tsc version to 1.3.11 and try to run the build script using npm run build. It will show the errors

Notes

I still don't know the root cause of this issue, but what is working for me is to downgrade the vue-tsc version to 1.3.2

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

2 participants