Skip to content

Nuxt-TS Build Error: Subsequent property declarations must have the same type. #180

@ykamal

Description

@ykamal

Versions

-1.7.11

Describe the bug

When using yarn generate on a nuxt + typescript + nuxt-composition-api project, I'm getting this error:
image

Text:

ERROR in node_modules/vue-toastification/src/types/index.ts:251:5
TS2717: Subsequent property declarations must have the same type.  Property '$toast' must be of type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }', but here has type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }'.
    249 | declare module "vue/types/vue" {
    250 |   interface Vue {
  > 251 |     $toast: ReturnType<typeof ToastInterface>;
        |     ^^^^^^
    252 |   }
    253 |
    254 |   interface VueConstructor {

ERROR in node_modules/vue-toastification/src/types/index.ts:255:5
TS2717: Subsequent property declarations must have the same type.  Property '$toast' must be of type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }', but here has type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }'.
    253 |
    254 |   interface VueConstructor {
  > 255 |     $toast: ReturnType<typeof ToastInterface>;
        |     ^^^^^^
    256 |   }
    257 | }
    258 |

ERROR in node_modules/vue-toastification/src/types/index.ts:261:5
TS2717: Subsequent property declarations must have the same type.  Property '$toast' must be of type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }', but here has type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }'.
    259 | declare module "@nuxt/types" {
    260 |   interface NuxtAppOptions {
  > 261 |     $toast: ReturnType<typeof ToastInterface>;
        |     ^^^^^^
    262 |   }
    263 | }
    264 |

ERROR in node_modules/vue-toastification/src/types/index.ts:267:5
TS2717: Subsequent property declarations must have the same type.  Property '$toast' must be of type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }', but here has type '{ (content: ToastContent, options?: ToastOptions | undefined): ToastID; clear(): any; updateDefaults(update: PluginOptions): void; ... 5 more ...; warning(content: ToastContent, options?: (ToastOptions & { ...; }) | undefined): ToastID; }'.
    265 | declare module "vuex/types/index" {
    266 |   interface Store<S> {
  > 267 |     $toast: ReturnType<typeof ToastInterface>;
        |     ^^^^^^
    268 |   }
    269 | }
    270 |

Expected behavior

yarn generate should complete without any errors.

Steps to reproduce

Steps:

  1. Set up project with Nuxt, Typescript, Nuxt Composition API
  2. Use the provider in a component and then use the toast in a child component
  3. run yarn generate

Your Environment

  • Device: PC
  • OS: Windows 10, Ubuntu 20 (problem exists in both OS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't workingstaleIssue was not updated for some time and may be closed in the future

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions