Closed breynolds closed 4 years ago
Hi,
I'm not to sure from first glance, it all looks like it should be working fine. I will have a dig around tomorrow and see what I can work out for you. Potentially it is something that has changed in a newer version of vuex-orm.
I will get back to you.
Ok, thanks for the info. If you need to, we can do a screen share.
On Mon, Nov 25, 2019 at 6:01 AM Scotley notifications@github.com wrote:
Hi,
I'm not to sure from first glance, it all looks like it should be working fine. I will have a dig around tomorrow and see what I can work out for you. Potentially it is something that has changed in a newer version of vuex-orm.
I will get back to you.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Scotley/vuex-orm-decorators/issues/3?email_source=notifications&email_token=AALNPMOOX6KYZ26HSV55QW3QVOV7PA5CNFSM4JRG4FEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFB75RI#issuecomment-558104261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALNPMJCNK3R65VJFAAGWXTQVOV7PANCNFSM4JRG4FEA .
Can you share a some complete code which reproduces this issue please?
I need a bit more info on your issue. because I am struggling to reproduce it.
Edit: Reproduced your bug finally. I will continue to investigate but it manifests differently in different vuex-orm versions.
Can you please confirm something for me.
If you try this:
store.dispatch('entities/races/insert', { data: { ID: 10, Name: 'Test' } })
console.log(Race.find(10));
Then you get the result that you expect and the race object is logged in the console.
but if you try:
Race.insert({ ID: 10, Name: 'Test' });
then you get the error.
(If this is your error, I don't have a fix or an explanation as it seems to be an issue with vuex-orm itself).
Not sure why, and unfortunately I am no longer actively using it as I developed my own style orm store as I didn't need the complexity of vuex-orm, but needed more flexibility. That is now my main focus :/
Still, if I have missed the mark entirely, drop a complete example of your bug and I will look further into it.
I just tried directly calling the dispatch, and got the same thing.
Don't worry about it. If you're not really going to actively use this code, I'll work out something else. Thanks for looking into it for me.
No dramas mate, I will pass this on to @Kiaking anyway and he might be able to confirm whether there is an issue in the base library or not.
Oh well that's because the argument is wrong. It should be;
Race.insert({
data: { ID: 10, Name: 'Test' } // <- You need `data` key.
});
Aha, legend @kiaking. Thanks for that, I was missing the obvious for so long. @breynolds, is this solving your issue? Perhaps you were making the same mistake as me?
Yeah, I had already tried that. Same issue.
On Nov 28, 2019, at 11:32 PM, Scotley notifications@github.com wrote:
Aha, legend @kiaking https://github.com/kiaking. Thanks for that, I was missing the obvious for so long. @breynolds https://github.com/breynolds, is this solving your issue? Perhaps you were making the same mistake as me?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Scotley/vuex-orm-decorators/issues/3?email_source=notifications&email_token=AALNPMO7TQ3FJUA4C3SUEWTQWCEMXA5CNFSM4JRG4FEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNY4RI#issuecomment-559648325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALNPMPBSIGFH66CDKGXRADQWCEMXANCNFSM4JRG4FEA.
When I try to insert into the DB, I get the error TypeError: this.types is not a function
Entity looks like this
store looks like this:
Also, maybe this is a clue.... in Vuex-Orm, this.setters is returning a value, but this.setters('all') is returning undefined.
From seeing the undefined basic fields and functions, it seems like the vuex-orm database isn't getting set up correctly. Any ideas?
I also posted this on StackOverflow to see if other people have ideas. https://stackoverflow.com/questions/59020879/typeerror-this-types-is-not-a-function-when-using-vuex-orm-decorators