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

Cannot find type definition file for 'vue/__globalTypes_3.4_false' #4738

Closed
MarkSky opened this issue Aug 29, 2024 · 10 comments · Fixed by #4740
Closed

Cannot find type definition file for 'vue/__globalTypes_3.4_false' #4738

MarkSky opened this issue Aug 29, 2024 · 10 comments · Fixed by #4740
Labels
bug Something isn't working

Comments

@MarkSky
Copy link

MarkSky commented Aug 29, 2024

Vue - Official extension or vue-tsc version

2.1.0

VSCode version

1.92.2

Vue version

3.4.38

TypeScript version

5.5.4

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 4.45 GB / 15.80 GB
  Binaries:
    Node: 22.3.0 - ~\AppData\Local\fnm_multishells\16464_1724891209939\node.EXE
    npm: 10.8.2 - ~\AppData\Local\fnm_multishells\16464_1724891209939\npm.CMD
    pnpm: 8.15.6 - ~\AppData\Local\pnpm\pnpm.EXE
    bun: 1.0.33 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Steps to reproduce

  1. Update 'vue-tsc' from 2.0.29 to 2.1.0
  2. npm run build
  3. it built error, and got the information:
 error TS2688: Cannot find type definition file for 'vue/__globalTypes_3.4_false'.

18 /// <reference types="vue/__globalTypes_3.4_false" />

What is expected?

It should build success just like the version 2.0.29.

What is actually happening?

There are a lot of errors.

Link to minimal reproduction

No response

Any additional comments?

No response

@lmm1990
Copy link

lmm1990 commented Aug 29, 2024

@johnsoncodehk Encountered the same problem

@KazariEX KazariEX added bug Something isn't working and removed pending triage labels Aug 29, 2024
@lmm1990
Copy link

lmm1990 commented Aug 29, 2024

Version rollback to "vue-tsc": "2.0.29" Return to normal

@luoxiangfan
Copy link

Encountered the same problem

@MarkSky
Copy link
Author

MarkSky commented Aug 29, 2024

If this error happened is the Volar update to 2.1.0?

@yanhao98
Copy link

新建一个项目就会发生。

Last login: Thu Aug 29 10:54:30 on ttys022
➜  Downloads pnpm create vue@latest
.../1919cfe0fe8-2aa1                     |   +1 +
.../1919cfe0fe8-2aa1                     | Progress: resolved 1, reused 1, downloaded 0, added 1, done

Vue.js - The Progressive JavaScript Framework

✔ 请输入项目名称: … vue-project
✔ 是否使用 TypeScript 语法? … 否 / 是
✔ 是否启用 JSX 支持? … 否 / 是
✔ 是否引入 Vue Router 进行单页面应用开发? … 否 / 是
✔ 是否引入 Pinia 用于状态管理? … 否 / 是
✔ 是否引入 Vitest 用于单元测试? … 否 / 是
✔ 是否要引入一款端到端(End to End)测试工具? › 不需要
✔ 是否引入 ESLint 用于代码质量检测? … 否 / 是
✔ 是否引入 Prettier 用于代码格式化? … 否 / 是
✔ 是否引入 Vue DevTools 7 扩展用于调试? (试验阶段) … 否 / 是

正在初始化项目 /Users/yanhao2023/Downloads/vue-project...

项目初始化完成,可执行以下命令:

  cd vue-project
  pnpm install
  pnpm format
  pnpm dev

➜  Downloads cd vue-project/                                    
➜  vue-project pnpm i                
 WARN  5 deprecated subdependencies found: @humanwhocodes/config-array@0.11.14, @humanwhocodes/object-schema@2.0.3, glob@7.2.3, inflight@1.0.6, rimraf@3.0.2
Packages: +429
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 466, reused 428, downloaded 1, added 429, done
node_modules/.pnpm/vue-demi@0.14.10_vue@3.4.38_typescript@5.4.5_/node_modules/vue-demi: Running postinstall script, done in 68ms

dependencies:
+ pinia 2.2.2
+ vue 3.4.38
+ vue-router 4.4.3

devDependencies:
+ @rushstack/eslint-patch 1.10.4
+ @tsconfig/node20 20.1.4
+ @types/jsdom 21.1.7
+ @types/node 20.16.2 (22.5.1 is available)
+ @vitejs/plugin-vue 5.1.2
+ @vitejs/plugin-vue-jsx 4.0.1
+ @vue/eslint-config-prettier 9.0.0
+ @vue/eslint-config-typescript 13.0.0
+ @vue/test-utils 2.4.6
+ @vue/tsconfig 0.5.1
+ eslint 8.57.0 (9.9.1 is available)
+ eslint-plugin-vue 9.27.0
+ jsdom 24.1.3 (25.0.0 is available)
+ npm-run-all2 6.2.2
+ prettier 3.3.3
+ typescript 5.4.5 (5.5.4 is available)
+ vite 5.4.2
+ vite-plugin-vue-devtools 7.3.9
+ vitest 1.6.0 (2.0.5 is available)
+ vue-tsc 2.1.0

Done in 5.8s
➜  vue-project pnpm outdated
┌───────────────────┬─────────┬────────┐
│ Package           │ Current │ Latest │
├───────────────────┼─────────┼────────┤
│ typescript (dev)  │ 5.4.5   │ 5.5.4  │
├───────────────────┼─────────┼────────┤
│ @types/node (dev) │ 20.16.2 │ 22.5.1 │
├───────────────────┼─────────┼────────┤
│ eslint (dev)      │ 8.57.0  │ 9.9.1  │
├───────────────────┼─────────┼────────┤
│ jsdom (dev)       │ 24.1.3  │ 25.0.0 │
├───────────────────┼─────────┼────────┤
│ vitest (dev)      │ 1.6.0   │ 2.0.5  │
└───────────────────┴─────────┴────────┘
➜  vue-project pnpm run type-check       

> vue-project@0.0.0 type-check /Users/yanhao2023/Downloads/vue-project
> vue-tsc --build --force

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

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

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

86 /// <reference types="vue/__globalTypes_3.4_false" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

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

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

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

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

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

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

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

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

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

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

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

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

src/views/HomeView.vue:10:23 - error TS2688: Cannot find type definition file for 'vue/__globaltypes_3.4_false'.

10 /// <reference types="vue/__globalTypes_3.4_false" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/views/AboutView.vue:16:23 - error TS2688: Cannot find type definition file for 'vue/__globaltypes_3.4_false'.

16 /// <reference types="vue/__globalTypes_3.4_false" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

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

86 /// <reference types="vue/__globalTypes_3.4_false" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

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

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

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

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

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

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

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

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

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

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

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

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

src/views/HomeView.vue:10:23 - error TS2688: Cannot find type definition file for 'vue/__globaltypes_3.4_false'.

10 /// <reference types="vue/__globalTypes_3.4_false" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/views/AboutView.vue:16:23 - error TS2688: Cannot find type definition file for 'vue/__globaltypes_3.4_false'.

16 /// <reference types="vue/__globalTypes_3.4_false" />
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 22 errors.

 ELIFECYCLE  Command failed with exit code 2.
➜  vue-project 

@davidmatter
Copy link
Collaborator

davidmatter commented Aug 29, 2024

Workaround for now: Add the following to your tsconfig.compilerOptions:

"paths": {
      "vue/__globalTypes_3.4_false": ["node_modules/vue/__globalTypes_3.4_false.d.ts"]
}

@mikeshi80
Copy link

I lost a lot of my hair because of this bug!!!

@fritx
Copy link

fritx commented Aug 29, 2024

Seems your hairs are unlucky today, you should have been using React ;) @mikeshi80

@aurora-lch
Copy link

you can also build only, don't check type

@fritx
Copy link

fritx commented Aug 29, 2024

I can confirm it works now. @aurora-lch

pnpm i -D vue-tsc@2.1.2
pnpm i -D @vue/typescript-plugin@2.1.2  # if exists: https://github.com/zed-industries/zed/issues/8336
pnpm build  # now it works

peacefulseeker added a commit to peacefulseeker/django-libraryms that referenced this issue Aug 31, 2024
an issue popped up with recent version of vue-tsc
vuejs/language-tools#4738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

11 participants