-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Discussed in #1754
Originally posted by erikjalevik December 22, 2023
I wanted to give this project a spin as it looks quite neat for what we need but I'm failing at the very first hurdle.
On trying to add pinia-orm to pinia, there's immediately a TypeScript error. Here's my code:
import { createORM } from 'pinia-orm';
const pinia = createPinia();
pinia.use(createORM());
TS says:
Argument of type '() => { use(plugin: PiniaOrmPlugin): any; }' is not assignable to parameter of type 'PiniaPlugin'.
Type '{ use(plugin: PiniaOrmPlugin): any; }' is not assignable to type 'void | Partial<PiniaCustomProperties<string, StateTree, _GettersTree<StateTree>, _ActionsTree> & PiniaCustomStateProperties<...>>'.ts(2345)
I also get
ERROR(vue-tsc) Argument of type '() => { use(plugin: PiniaOrmPlugin): any; }' is not assignable to parameter of type 'PiniaPlugin'.
Type '{ use(plugin: PiniaOrmPlugin): any; }' is not assignable to type 'void | Partial<PiniaCustomProperties<string, StateTree, _GettersTree<StateTree>, _ActionsTree> & PiniaCustomStateProperties<...>>'.
adding this plugin to pinia using Quasar + Vite.
Template: https://github.com/MartinX3/pinia_orm_quasar_ts_error_test
I just did
pnpm create quasar- With qusar cli, vite 5, typescript, scss, script setup, etc.
- pnpm add pinia-orm
.use(createORM())- Updated the deps (but it happens without this step, too)
quasar dev
It works with:
// @ts-expect-error TODO Workaround for https://github.com/CodeDredd/pinia-orm/discussions/1754 & https://github.com/CodeDredd/pinia-orm/issues/1813
pinia.use(createORM())CodeDredd
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working