Typescript plugin incompatible with latest Vue patch 3.2.46
saxelsen opened this issue ยท 2 comments
saxelsen commented
After patching Vue3 to 3.2.46, the Typescript compiler fails to install the coreui/vue plugin:
Argument of type '{ install: (app: App<any>, options: any) => void; }' is not assignable to parameter of type 'Plugin_2<[]>'.
Type '{ install: (app: App<any>, options: any) => void; }' is not assignable to type '{ install: (app: App<any>) => any; }'.
Types of property 'install' are incompatible.
Type '(app: App<any>, options: any) => void' is not assignable to type '(app: App<any>) => any'.
13 app.use(CoreuiVue);
Found 1 error in src/main.ts:13
It appears that the install method doesn't match the expected signature.
Using
import CoreuiVue from '@coreui/vue';
....
app.use(CoreuiVue, {});
fixes the problem.
- Operating system and version: macOS 13.0.1 and Docker image
node:18-alpine3.16. - Browser: Firefox 109.0.1
- CoreUI version: 4.2.6
- CoreUI/vue version: 4.6.1
dforce2055 commented
I had the same issue.
ERROR Failed to compile with 1 error 12:24:35
error in src/main.ts:36:9
TS2345: Argument of type '{ install: (app: App<any>, options: any) => void; }' is not assignable to parameter of type 'Plugin_2<[]>'.
Type '{ install: (app: App<any>, options: any) => void; }' is not assignable to type '{ install: (app: App<any>) => any; }'.
Types of property 'install' are incompatible.
Type '(app: App<any>, options: any) => void' is not assignable to type '(app: App<any>) => any'.
...
> 36 | app.use(CoreuiVue)
| ^^^^^^^^^
...
ERROR Error: Build failed with errors.
This solve the problem ๐ ๐ ๐
app.use(CoreuiVue, {})
I was close, because it has happened to me, with another (homemade) plugin that I implemented to use firebase.
main.ts
import firebase from '@/plugins/firebase'
app.use(firebase, {}, { ...store })
/plugins/firebase.ts
export default {
install: (app, options, store) => {
...
}
signature
(property) install: (app: any, options: any, store: any) => void
Thanks for the help. @saxelsen ๐๐ป
github-actions commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions