question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[vue-tsc] errors happening when using > 0.32.1

See original GitHub issue

Expected behavior

Running vue-tsc --noEmit should run without any errors

Actual behavior

Running vue-tsc --noEmit will output the following errors:

node_modules/@babel/parser/typings/babel-parser.d.ts:14:23 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

14 ): ParseResult<import("@babel/types").File>;
                         ~~~~~~~~~~~~~~

node_modules/@babel/parser/typings/babel-parser.d.ts:22:23 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

22 ): ParseResult<import("@babel/types").Expression>;
                         ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:1:57 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

1 import type { BlockStatement as BlockStatement_2 } from '@babel/types';
                                                          ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:2:45 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

2 import type { Function as Function_2 } from '@babel/types';
                                              ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:4:33 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

4 import type { Identifier } from '@babel/types';
                                  ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:5:37 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

5 import type { Node as Node_3 } from '@babel/types';
                                      ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:6:37 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

6 import type { ObjectProperty } from '@babel/types';
                                      ~~~~~~~~~~~~~~

node_modules/@vue/compiler-core/dist/compiler-core.d.ts:8:30 - error TS2307: Cannot find module '@babel/types' or its corresponding type declarations.

8 import type { Program } from '@babel/types';

Info

  1. vue-tsc: 0.33.9
  2. typescript: 4.6.3
  3. vite: 2.8.6

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
tomhooijengacommented, Mar 29, 2022

npm i -D @babel/types is also a workaround. This keeps the type checking for other libs.

1reaction
johnsoncodehkcommented, Apr 3, 2022

@babel/types is not a indirect depend of vue-tsc after 0.33.0, this is correct error because @vue/compiler-core do not have @babel/types in dependencies, please report to upstream or just send a PR.

https://github.com/vuejs/core/blob/245230e135152900189f13a4281302de45fdcfaa/packages/compiler-core/package.json#L41

Read more comments on GitHub >

github_iconTop Results From Across the Web

Volar and vue-tsc are showing different TS errors
I use VS Code with Volar. Now on one hand I have all my TS errors printed in the console which is what...
Read more >
vue-tsc - npm
Install: `npm i vue-tsc -D`. Latest version: 1.0.13, last published: 20 hours ago. Start using vue-tsc in your project by running `npm i...
Read more >
vue-tsc | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Vue 3 Setup: Vue TypeScript Service false errors not ...
Create a Vue 3.2.37 app, with vue-tsc 0.38.1 , vite 2.9.12 & @vitejs/plugin-vue 2.3.3. 2. Create a test component: <template> <h1>test</h1> </template>.
Read more >
vue/test-utils: Versions - Openbase
Full version history for @vue/test-utils including change logs. ... fix: allow to use KeepAlive or keep-alive in stubs by @cexbrayat in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found