pinia-orm
pinia-orm copied to clipboard
Axios Plugin Documentation is Broken
Environment
Quasar 2.12.2 JavaScript Pinia Pinia-Orm Pinia-Orm/axios
Reproduction
Follow the Documentation from the Plugin, to Configure Axios and Create an Axios Repository you are supposed to import:
import { createPiniaOrmPluginAxios } from "@pinia-orm/axios";
this results in the following waring in the quasar console:
export 'createPiniaOrmPluginAxios' (imported as 'createPiniaOrmPluginAxios') was not found in '@pinia-orm/axios' (possible exports: AxiosRepository, Request, Response, createPiniaOrmAxios, piniaOrmPluginAxios, useAxiosApi, useAxiosRepo)
Seems like the createPiniaOrmPluginAxios does not exist.
Describe the bug
The documentation is wrong, or the package is wrong, either way, following the documentation results in errors.
Additional context
Also the documentation is very very very basic. There are no examples on how to create a repository, when to use useRepo or useAxios repo, there is no example on creating a repo (should it inherit from Repository from pinia-orm or should it inherit from AxiosRepository?
Please update the documentation and also maybe include a standard example for a vue app using Pinia/Pinia-Orm and the Pinia-ORM/Axios plugin, I think this would help new Users on how to use Pinia-ORM with axios.
Logs
export 'createPiniaOrmPluginAxios' (imported as 'createPiniaOrmPluginAxios') was not found in '@pinia-orm/axios' (possible exports: AxiosRepository, Request, Response, createPiniaOrmAxios, piniaOrmPluginAxios, useAxiosApi, useAxiosRepo)
This looks very similar to #1687 .
I get a similar error:
RollupError: "createPiniaOrmPluginAxios" is not exported by "node_modules/@pinia-orm/axios/dist/index.mjs",
node 20.10.0
"vite": "^5.0.12", "@pinia-orm/axios": "^1.7.0", "pinia-orm": "^1.7.2",
Seems like createPiniaOrmPluginAxios is not found. Using createPiniaOrmAxios instead of createPiniaOrmPluginAxios solves the problem.