Skip to content

Typescript Error for Vue 2.7.14 #1281

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

Closed
glumb opened this issue Jan 20, 2023 · 2 comments
Closed

Typescript Error for Vue 2.7.14 #1281

glumb opened this issue Jan 20, 2023 · 2 comments

Comments

@glumb
Copy link
Contributor

glumb commented Jan 20, 2023

Reproduction

https://github.com/glumb/repro-vuefire-ts

Steps to reproduce the bug

  1. create new Vue 2.7 project with typescript vue create repro-vuefire-ts
  2. install firebase & vuefire
  3. add to main.ts import { firestorePlugin } from "vuefire"; Vue.use(firestorePlugin);
  4. run npm run serve

Expected behavior

no errors

Actual behavior

 ERROR  Failed to compile with 1 error                                                                                                                     15:23:25

 error  in ../node_modules/vuefire/dist/shared/vuefire.823f1be4.mjs

export 'ssrContextKey' (imported as 'ssrContextKey') was not found in 'vue-demi' (possible exports: EffectScope, Vue, Vue2, computed, createApp, customRef, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, install, isProxy, isReactive, isReadonly, isRef, isShallow, isVue2, isVue3, markRaw, mergeDefaults, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useListeners, useSlots, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect)

ERROR in ../node_modules/vuefire/dist/shared/vuefire.823f1be4.mjs 56:43-56
export 'ssrContextKey' (imported as 'ssrContextKey') was not found in 'vue-demi' (possible exports: EffectScope, Vue, Vue2, computed, createApp, customRef, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, install, isProxy, isReactive, isReadonly, isRef, isShallow, isVue2, isVue3, markRaw, mergeDefaults, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useListeners, useSlots, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect)
 @ ../node_modules/vuefire/dist/index.mjs 2:0-434 3:0-183 3:0-183 3:0-183 3:0-183 3:0-183 3:0-183 3:0-183 45:9-33 45:49-65 45:105-124 45:170-188 49:14-28 62:51-55 65:15-29 74:9-17 94:20-24 119:33-37 120:35-39 121:35-39 122:33-37 123:28-32 176:15-19 181:26-44 185:6-11 188:79-93 194:29-33 200:17-21 222:20-24 276:21-35 291:7-13 311:17-30 322:17-25 348:75-82 362:15-19 412:18-25 439:23-27 492:22-26 526:12-27 526:43-50 527:23-27 551:15-19 556:26-44 560:6-11 563:79-93 569:29-33 575:17-21 583:16-29 596:20-24 634:31-38 648:22-36 690:18-32 690:48-62 768:18-32 768:48-62 816:17-31 817:4-19 818:4-27 822:9-17 822:28-42 825:20-34 830:69-83 832:29-33 865:111-125 868:29-33 926:14-18 996:14-38 1001:0-592
 @ ./src/main.ts 3:0-42 5:8-23

webpack compiled with 1 error
ERROR in src/main.ts:7:9
TS2769: No overload matches this call.
  Overload 1 of 2, '(plugin: PluginObject<FirestorePluginOptions> | PluginFunction<FirestorePluginOptions>, options?: FirestorePluginOptions | undefined): VueConstructor<...>', gave the following error.
    Argument of type '(app: App<any>, pluginOptions?: FirestorePluginOptions | undefined, firebaseApp?: FirebaseApp | undefined) => void' is not assignable to parameter of type 'PluginObject<FirestorePluginOptions> | PluginFunction<FirestorePluginOptions>'.
      Type '(app: App<any>, pluginOptions?: FirestorePluginOptions | undefined, firebaseApp?: FirebaseApp | undefined) => void' is not assignable to type 'PluginFunction<FirestorePluginOptions>'.
        Types of parameters 'app' and 'Vue' are incompatible.
          Type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>>' is missing the following properties from type 'App<any>': provide, mount, unmount
  Overload 2 of 2, '(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<...>>>', gave the following error.
    Argument of type '(app: App<any>, pluginOptions?: FirestorePluginOptions | undefined, firebaseApp?: FirebaseApp | undefined) => void' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
      Type '(app: App<any>, pluginOptions?: FirestorePluginOptions | undefined, firebaseApp?: FirebaseApp | undefined) => void' is not assignable to type 'PluginFunction<any>'.
        Types of parameters 'app' and 'Vue' are incompatible.
          Type 'VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, ...>>>' is not assignable to type 'App<any>'.
     5 | Vue.config.productionTip = false;
     6 |
  >  7 | Vue.use(firestorePlugin);
       |         ^^^^^^^^^^^^^^^
     8 |
     9 | new Vue({
    10 |   render: (h) => h(App),

Additional information

No response

@posva
Copy link
Member

posva commented Jan 20, 2023

Duplicate of #1280

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2023
@posva posva marked this as a duplicate of #1280 Jan 20, 2023
@glumb
Copy link
Contributor Author

glumb commented Jan 20, 2023

When using typescript actually two errors occur. First the one from #1280 and second the one reported in this issue.

#1280 is not related to typescript.

So this issue is basically a superset of the two issues. I would recommend to keep this one open and close the other one.
Sorry for the confusion. 😕

Regarding the discussion I also started 😅: first I was unsure if it's wrong usage on my end so I didn't want to create a bug report. After I could reproduce it, I created the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants