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

Typing error with app.use(), requiring 2nd argument #7729

Closed
hongquan opened this issue Feb 16, 2023 · 4 comments
Closed

Typing error with app.use(), requiring 2nd argument #7729

hongquan opened this issue Feb 16, 2023 · 4 comments

Comments

@hongquan
Copy link

Vue version

3.2.47

Link to minimal reproduction

https://bitbucket.org/hongquan/vue-wrong-argument-for-use

Steps to reproduce

  • Clone the repo above
  • Run yarn build

What is expected?

No error

What is actually happening?

Typing error raises at app.use(fluent)

System Info

System:
    OS: Linux 5.19 Ubuntu 22.10 22.10 (Kinetic Kudu)
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 6.45 GB / 11.59 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 18.14.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.3.1 - /usr/bin/npm
  Browsers:
    Chrome: 110.0.5481.100
    Firefox: 110.0
  npmPackages:
    vue: ^3.2.47 => 3.2.47

Any additional comments?

Log:

yarn build
yarn run v1.22.19
$ vue-tsc && vite build
src/main.ts:22:5 - error TS2554: Expected 2 arguments, but got 1.

22 app.use(fluent)
       ~~~~~~~~~~~

  node_modules/@vue/runtime-core/dist/runtime-core.d.ts:78:63
    78     use<Options extends unknown[]>(plugin: Plugin_2<Options>, ...options: Options): this;
                                                                     ~~~~~~~~~~~~~~~~~~~
    Arguments for the rest parameter 'options' were not provided.


Found 1 error in src/main.ts:22
@LinusBorg
Copy link
Member

Bug introduced here:

c513126

@LinusBorg LinusBorg added 🐞 bug Something isn't working scope: types labels Feb 16, 2023
LiuDao-C added a commit to LiuDao-C/core that referenced this issue Feb 16, 2023
LiuDao-C added a commit to LiuDao-C/core that referenced this issue Feb 16, 2023
LiuDao-C added a commit to LiuDao-C/core that referenced this issue Feb 16, 2023
@baiwusanyu-c
Copy link
Member

#7731

@LinusBorg
Copy link
Member

LinusBorg commented Feb 16, 2023

Hm, I took another look. I think acutally, our types are fine. The problem is with the types of fluent-vue:

https://github.com/fluent-vue/fluent-vue/blob/fdc1fbcd45053415c55c86b2885534bed26451c6/src/types/typesCompat.ts#L26

export type InstallFunction<TOptions> = (vue: unknown, options: TOptions) => void

FluentVue claims that it needs an options object. It's just that before c513126, the types for app.use() did not reflect that.

@LinusBorg LinusBorg removed the 🐞 bug Something isn't working label Feb 16, 2023
@hongquan
Copy link
Author

This is fluent-vue's bug, so I close this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants