Skip to content

Import store in eager components causes a circular dependency #112

Open
@stefanosandes

Description

@stefanosandes

The problems only happens on eager components.

For example:

If you import and log the store on app/auth/components/main.vue, the output is the store object. But, if you make this component eager and run de test again, the output will be undefined.

I belive that the problem is caused by an circular dependency:

store/index -> store/modules -> app/index -> app/routes -> app/auth/index -> app/auth/routes -> app/auth/components/main -> src/store

In my specific case, a need to use the store inside de vue-router beforeRouteEnter guard to access some info in the store. Inside this guard, this.$route will not be available, because the component instance has no created yet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions