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-tsc Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'. #4746

Closed
Tommytrg opened this issue Aug 29, 2024 · 8 comments · Fixed by #4749
Closed
Labels
bug Something isn't working 🔩 p2-edge-case

Comments

@Tommytrg
Copy link

Vue - Official extension or vue-tsc version

2.1.2

VSCode version

1.92.2

Vue version

3.4.38

TypeScript version

5.4.5

System Info

No response

Steps to reproduce

  1. Create an empty project with pnpm create vue@latest using typescript and install dependencies.
    image

  2. Run pnpm type-check which runs vue-tsc --build --force
    image

What is expected?

Get an output without errors

What is actually happening?

The type-check script is failing with the following errors:

src/components/HelloWorld.vue:42:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

42 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/WelcomeItem.vue:88:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

88 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/icons/IconDocumentation.vue:8:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

8 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/icons/IconTooling.vue:20:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

20 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/icons/IconEcosystem.vue:8:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

8 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/icons/IconCommunity.vue:8:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

8 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/icons/IconSupport.vue:8:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

8 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/TheWelcome.vue:89:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

89 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/App.vue:48:23 - error TS2688: Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'.

48 /// <reference types="vue/dist/__globalTypes_3.4_false.d.ts" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 9 errors.

 ELIFECYCLE  Command failed with exit code 2.

Link to minimal reproduction

https://codesandbox.io/p/github/Tommytrg/vue-tsc-error/main?import=true

Any additional comments?

No response

@Tommytrg Tommytrg changed the title Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'. vue-tsc Cannot find type definition file for 'vue/dist/__globaltypes_3.4_false.d.ts'. Aug 29, 2024
@KazariEX
Copy link
Collaborator

Have you enabled hybrid mode? And check if __globalTypes_3.4_false.d.ts exists.

@Tommytrg
Copy link
Author

I have hybrid mode enabled and I don't see any error in vscode.

image

I had the issue after upgrading vue-tsc to 2.1.2. If I downgrade back to 2.0.29, it works.

@KazariEX KazariEX added bug Something isn't working 🔩 p2-edge-case and removed need info labels Aug 29, 2024
@KazariEX
Copy link
Collaborator

This problem may be related to whether the file system is case-sensitive.

Could you try converting the __globalTypes_3.4_false.d.ts file located under vue/dist to lowercase and checking if tsc passes?

@Tommytrg
Copy link
Author

That's the problem. tsc passes when the file name is lowercase.

image

image

Also, my file system is case-sensitive:

image

@KazariEX
Copy link
Collaborator

That's a bit weird, please use this workaround temporarily.

@codethief
Copy link

I saw the same issue on Linux / ext4 right after upgrading vue-tsc from 2.0.29 to 2.1.2 earlier. However, in the last hour or so I've switched branches a few times (-> downgrading & upgrading vue-tsc a few more times), deleted my node_modules etc. and now the error no longer shows up. Weird.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Aug 29, 2024

Can you try using pkg.pr.new to see if #4749 fixes the problem?

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-tsc@4749

@Tommytrg
Copy link
Author

#4749 fixes the problem. Thank you for the quick reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔩 p2-edge-case
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants