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

Uncaught (in promise) Error: cannot populate because path has no ref (name) #75

Closed
chopfitzroy opened this issue Mar 6, 2017 · 7 comments

Comments

@chopfitzroy
Copy link

Case

Bug

Issue

Receiving the following error when trying to add to retrieve collection:
selection_001

Info

  • Environment: Electron
  • Adapter: IndexedDB

Code

I have the following listing component in vue (derived from example code):

import * as Storage from '../storage';
import Banner from '../components/Banner';
import Preview from '../components/Preview';

export default {
    name: 'Listing',
    components: {
        Banner,
        Preview
    },
    data() {
        return {
            title: 'Please select Assignment',
            assignments: []
        };
    },
    mounted: async function() {
        const db = await Storage.get();
        let filter = [];
        filter.push(
            db.assignments
                .find().$
                .filter(x => x != null)
                .subscribe(assignments => {
                    console.log('results:');
                    this.assignments = assignments;
                })
        );
    },
    beforeDestroy() {
        this.assignments.forEach(sub => sub.unsubscribe());
    },
    methods: {
        // removeHero(hero) {
        //     hero.remove();
        // },
        // editHero(hero) {
        //     this.$emit('edit', hero);
        // }
    },
    template: require('./Listing.html')
}
@pubkey
Copy link
Owner

pubkey commented Mar 6, 2017

Hi @CrashyBang
I'm aware of this problem. It looks like vuejs is calling every getter on it's change-detection.
I'm still trying to figure out if this is something vuejs should do or if RxDB is the problem.

A workarround would be to only set the lodash-getter (for populate()) if the ref is set. But this would still have a bad performance when ref exists, since vuejs would call the population-trigger every time.

Do you know if something like angular2's async-pipe exists in vuejs?

@chopfitzroy
Copy link
Author

Hey @pubkey,

I don't but I might know someone who does, either way I will do some exploring and see if I can find you a promising fix :),

Cheers.

@chopfitzroy
Copy link
Author

Hey @pubkey,

I have had a look into the Vue Async Update Queue as well as vue-rx but I am having trouble understanding the problem.

I am not overly familiar with RxJS other than knowing it is used for observable streams and reactivity.

I might not be the best person to fix this, but perhaps if I can get a clearer understanding I can be more help?

Cheers.

@pubkey pubkey closed this as completed in 5dbe535 Mar 12, 2017
@chopfitzroy
Copy link
Author

chopfitzroy commented Mar 12, 2017

Noticed you closed this issue has it been resolved?

EDIT: Shoot sorry my mobile client didn't show the commit reference.

@pubkey
Copy link
Owner

pubkey commented Mar 12, 2017

Yes its resolved. I will push a patch-version to npmjs after the tests have run in windows-vms

@chopfitzroy
Copy link
Author

Hey @pubkey awesome I was just about to install the specific commit but will wait for the patch :).

@pubkey
Copy link
Owner

pubkey commented Mar 12, 2017

@CrashyBang patch is published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants