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.

TypeScript errors with `vue-tsc --noEmit`

See original GitHub issue

Reproduction

On demand

Steps to reproduce the behavior

  1. Create a Vue2 project
  2. Setup a store / use pinia
  3. Run yarn vue-tsc --noEmit

Expected behavior

No compile time TS errors

Actual behavior

$ yarn vue-tsc --noEmit
node_modules/pinia/dist/pinia.d.ts:3:10 - error TS2305: Module '"vue-demi"' has no exported member 'DebuggerEvent'.

3 import { DebuggerEvent } from 'vue-demi';
           ~~~~~~~~~~~~~

node_modules/pinia/dist/pinia.d.ts:5:10 - error TS2305: Module '"vue-demi"' has no exported member 'Plugin'.

5 import { Plugin as Plugin_2 } from 'vue-demi';
           ~~~~~~

node_modules/pinia/dist/pinia.d.ts:516:42 - error TS2315: Type 'App' is not generic.

516 export declare const PiniaPlugin: ((app: App<any>, ...options: any[]) => any) & {
                                             ~~~~~~~~

node_modules/pinia/dist/pinia.d.ts:517:22 - error TS2315: Type 'App' is not generic.

517     install?: ((app: App<any>, ...options: any[]) => any) | undefined;
                         ~~~~~~~~


Found 4 errors.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Shinigami92commented, Nov 3, 2021

Patch for 2.0.1

diff --git a/dist/pinia.d.ts b/dist/pinia.d.ts
index e0b5f993dc45072df1d0a8ad110d22785d8d663d..6f8ca69c1221566998f4d5040bf53a08d0432355 100644
--- a/dist/pinia.d.ts
+++ b/dist/pinia.d.ts
@@ -1,7 +1,9 @@
 import { App } from 'vue-demi';
 import { ComputedRef } from 'vue-demi';
+// @ts-ignore
 import { DebuggerEvent } from 'vue-demi';
 import { EffectScope } from 'vue-demi';
+// @ts-ignore
 import { Plugin as Plugin_2 } from 'vue-demi';
 import { Ref } from 'vue-demi';
 import { ToRefs } from 'vue-demi';

Maybe I could look into that later if I have some time, but not sure. For now I use the local patch, cause in the long run we switch to pinia cause we want to migrate to Vue 3 anyways someday

1reaction
posvacommented, Nov 3, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors building with vue-tsc --noEmit · Issue #318 - GitHub
I'm running into typescript errors on every single component when trying to build a project with vite and vue-tsc (using Vue3 and TypeScript):....
Read more >
Vue 3 + Vite + Typescript - dev & build not picking up TS Errors
It assumes type checking is taken care of by your IDE and build process (you can run tsc --noEmit in the build script...
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
vue-tsc - npm
[x] Type-Checking with --noEmit; [x] Use released LSP module; [x] Make typescript as peerDependencies; [x] Cleaner dependencies (remove prettyhtml ...
Read more >
[Solved]-VSCode shows different error than Vue CLI build-Vue.js
In Vue 3 and the Volar language server (or VSCode extension) there are two versions of the TypeScript compiler: tsc - the standard...
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