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

Not possible to use VueAnnouncer plugin (v3.1.2) in TS project #20

Open
pertoyra opened this issue Jan 29, 2021 · 9 comments
Open

Not possible to use VueAnnouncer plugin (v3.1.2) in TS project #20

pertoyra opened this issue Jan 29, 2021 · 9 comments

Comments

@pertoyra
Copy link

When following "Basic usage" README section of VueAnnouncer v3.1.2 in a typescript Vue 3 project the below error occurs when installing the plugin using:

createApp(App)
  .use(VueAnnouncer)

Error

Argument of type 'typeof import(".../node_modules/@vue-a11y/announcer/dist/index")' is not assignable to parameter of type 'Plugin_2'.
  Property 'install' is missing in type 'typeof import(".../node_modules/@vue-a11y/announcer/dist/index")' but required in type '{ install: PluginInstallFunction; }'. ts(2345)

Reproducible by creating a simple Vue 3 TS application with Vue CLI.

Environment:

  • VueAnnouncer v3.1.2
  • Vue v3.0.5
  • Typescript v3.9.7
@ktquez
Copy link
Member

ktquez commented Jan 30, 2021

Hi @pertoyra

I will identify and correct this weekend.

Sorry, but I'm starting to learn TypeScript, so if you have any idea how to solve this, I would like to hear it.

@per-toyra-stratsys
Copy link

@ktquez Sorry for my late response. If you haven't looked closer at this I might have a look this afternoon.

@Evertvdw
Copy link

Evertvdw commented Apr 6, 2021

I have this same issue, have you looked at this yet?

@ktquez
Copy link
Member

ktquez commented Apr 8, 2021

@Evertvdw @per-toyra-stratsys
I made some updates, could you test with version 3.1.4?

@per-toyra-stratsys
Copy link

@ktquez Just tested to upgrade to 3.1.4 with no other changes and still getting the same problem. Didn't investigate further though and haven't been able to look into this issue.

Are you able to install 3.1.4 in a fresh Vue 3 application created with Vue CLI and use vue-announcer?

@ktquez
Copy link
Member

ktquez commented Apr 12, 2021

@per-toyra-stratsys

Yeah!

I don't get any more errors in the installation, and now it is possible to know the methods available in the composition useAnnouncer.

I tested on projects created with vue-cli and Vite.

@Evertvdw
Copy link

@ktquez It seems that solves my problem. I can't be completely sure because I'm in the middle of upgrading to Vue 3 and a lot of stuff is broken at the moment. But I do not get this type error anymore at this moment, so I assume that it works.

@ktquez
Copy link
Member

ktquez commented Apr 13, 2021

@pertoyra
If you need any help to solve this, count on me.

@Evertvdw
Copy link

@ktquez I get a different error now with [email protected]

Argument of type '(app: App<any>, options?: VueAnnouncerOptions | undefined) => void' is not assignable to parameter of type 'Plugin_2'.
  Type '(app: App<any>, options?: VueAnnouncerOptions | undefined) => void' is not assignable to type 'PluginInstallFunction & { install?: PluginInstallFunction | undefined; }'.
    Type '(app: App<any>, options?: VueAnnouncerOptions | undefined) => void' is not assignable to type 'PluginInstallFunction'.
      Types of parameters 'app' and 'app' are incompatible.
        Type 'import("C:/Users/evert/Programming/Mett4Frontend/node_modules/@vue/runtime-core/dist/runtime-core").App<any>' is not assignable to type 'import("C:/Users/evert/Programming/Mett4Frontend/node_modules/@vue-a11y/announcer/node_modules/@vue/runtime-core/dist/runtime-core").App<any>'.
          The types of 'config.isCustomElement' are incompatible between these types.
            Type '((tag: string) => boolean) | undefined' is not assignable to type '(tag: string) => boolean'.
              Type 'undefined' is not assignable to type '(tag: string) => boolean'.

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

4 participants