What could be causing Vuexfire to update the UI correctly but not the state?

Currently, I am in the process of setting up vuexfire with firestore for a project. Following the documentation provided, I believe I have correctly configured everything. Interestingly, I was able to fetch data from firestore within a component using vuex/vuexfire and display it accurately on the UI. However, upon inspecting the state in the devtools, I noticed that my state remained unchanged.

To initiate my project, I utilized the vue-cli and closely adhered to the vuexfire docs as well as examples for creating a basic todo application.

Below is an excerpt from my store file:

import Vue from 'vue'
import Vuex from 'vuex'
import { vuexfireMutations, firestoreAction } from 'vuexfire'
import { db } from './db'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    todos: []
  },
  mutations: {
    ...vuexfireMutations
  },
  actions: {
    bindTodos: firestoreAction(({ bindFirestoreRef }) => {
      return bindFirestoreRef('todos', db.collection('todos'))
    }),
    unbindTodos: firestoreAction(({ unbindFirestoreRef }) => {
      unbindFirestoreRef('todos')
    })
  }
})

Furthermore, here is the fundamental component responsible for loading and presenting the user interface:

<template>
  <div>
    <h1>Home</h1>
    <p v-for="todo in todos" :key="todo.id">{{ todo.name }}</p>
  </div>
</template>

<script>
import { mapState, mapActions } from 'vuex'

export default {
  name: 'Home',
  computed: { ...mapState(['todos']) },
  methods: { ...mapActions(['bindTodos']) },
  created: function () {
    this.bindTodos()
  }
}
</script>

Although the UI successfully displays the todos, unfortunately, the state seems unaffected:

I've attempted refreshing the state in the devtools without success. Any guidance or assistance would be greatly appreciated!

Answer №1

Inspect Element

  • Options
    • Custom CSS styles: ON

Answer №2

After investigating, I discovered that the issue stemmed from a conflict with the Vue dev tools extension on Chrome. I ultimately resolved it by uninstalling and reinstalling the extension, which successfully fixed the problem. The state was updating as expected, but the dev tools failed to display the changes.

I hope this solution proves helpful to others encountering a similar challenge in the future!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Smart method for repositioning multiple elements on the display

Imagine we have multiple divs displayed on a screen: https://i.stack.imgur.com/jCtOj.png ...and our goal is to move them collectively, either to the left: https://i.stack.imgur.com/KBfXC.png ...or to the right: https://i.stack.imgur.com/c1cUw.png An ...

To retrieve the request parameter within the socket.on operation

As a newcomer to node.js, I may have made some mistakes along the way. Please bear with me. When trying to retrieve parameters passed in the URL like localhost:3000?id=man&fm=gilli, I used the following code: app.get('/',function(req, re ...

How can we maintain reactivity while updating the entire object from the server in Vue.js 2?

I have a list of items that are initially loaded with just id and name from the database. However, upon clicking on an item, additional fields can be fetched dynamically, and these fields can vary in length. While updating an item, I encountered reactivi ...

Converting text to JSON using JSONP with jQuery's AJAX functionality

Potential Duplicate Question 1 Possible Duplicate Inquiry 2 I have been searching for a definitive explanation on JSONP across various questions but haven't been able to find one yet. For instance, I am attempting to make a cross domain request us ...

Header Express does not contain any cookies, which may vary based on the specific path

In my express.js app, I have two controllers set up for handling requests: /auth and /posts. I've implemented token authorization to set the Authorization cookie, but I'm encountering an issue when making a request to /posts. The request goes th ...

An odd issue has arisen where the website functions properly in Firefox 3.0 but encounters problems when accessed in Firefox 3

Could someone investigate this issue for me? When you click on the showcase and then on the logo, a modal window should open with the logo. It works perfectly in FF 3.0, but in FF 3.5, the tab switches from showcase to home after clicking the logo. Even ...

Unable to invoke a function declared in an external JavaScript file

Desire to experiment with an external JavaScript file arose, but encountered difficulties in invoking a function defined within. Every attempt at calling it resulted in the error message "Uncaught ReferenceError: calculate (function name) is not defined." ...

`18n implementation in Node.js and front-end JavaScript for localization`

I am currently utilizing express js 4.0 and have set up the i18n module from https://github.com/mashpie/i18n-node in combination with ejs views. My goal is to extend this i18n functionality to .js files as well. Is there a way to enable the i18n function ...

Shuffle and Arrange Divs - Slick.JS

Incorporating the slick.js library, I have implemented the following code snippet in my web page to shuffle the slides within the carousel. JavaScript/jQuery: $('.qa').on('init', function(event, slick, currentSlide, nextSlide) { / ...

It appears that the home page of next.js is not appearing properly in the Storybook

Currently, I am in the process of setting up my next home page in storybooks for the first time. Following a tutorial, I successfully created my next-app and initialized storybooks. Now, I am stuck at importing my homepage into storybooks. To achieve this, ...

Creating Beautiful Math Equations with LaTeX in EaselJS

Can MathJAX or a similar tool be integrated into an EaselJS DisplayObject? I am looking for alternative options. I want to render text like $$ 5 + 3 - 3 = 5 $$ on a canvas that serves as an EaselJS stage. Ideally, I hope to achieve this using the Text Cl ...

The search functionality is malfunctioning within the JavaScript table

I am working with a table that I want to filter based on input values. However, the current filtering function is not working as expected. I have utilized an onkeyup function for the filtering process. For more details and a live example, check out the jsf ...

Incorporating a Jade template using AJAX while attempting to transmit and retrieve data independently from the HTML structure

While working with Express and rendering a Jade template on an ajax call using res.render, I encountered an issue. I wanted to pass JSON variables or Javascript objects along with the HTML content. Is there an elegant way to achieve this, or is it even po ...

I would like to retrieve an array of objects containing state and count information from this data in ReactJS

I have a dataset stored in an array of objects as follows [{name,state},{name,state},{name,state},{name,state},{name,state}]. I am interested in extracting the state data along with the number of people belonging to each state. To achieve this, I would l ...

Vue ceased to refresh the state of a particular variable

After attempting to populate a table using an axios get request and then trying to implement a Vuetify version of the table without success, I reverted the changes. However, now I am facing an issue where the data is not showing up in my table. Here is a ...

Is there a clash between jquery_ujs and Kaminari AJAX functionality in Rails 4?

After some investigation, it seems that there is a conflict between jquery_ujs and Kaminari's AJAX support in my Rails 4 application. Within my application.js file, I have included the following: //= require jquery //= require jquery_ujs //= require ...

Developing a TypeScript library through modular class implementation

I have developed a Web API and now I want to streamline my code by creating a library that can be reused in any new project I create that interacts with this API. My goal is to organize my code efficiently, so I plan to have separate classes for each endp ...

Executing a Particular Function in PHP with Arguments

As a newcomer to PHP and JavaScript, I'm attempting to invoke a specific function in a PHP file from JavaScript. Here is my code: <script> function load($dID) { $.ajax({ url: "myPHP.php", ...

Using HTML and C# to Deliver Emails

I've encountered a challenge with my HTML page that includes a textbox for users to input their email. When the submit button is clicked, an email should be sent to a specific email address defined in the code, and a pop-up box indicating "Email Sent" ...

Tips for implementing conditional rendering with ReactJS

I have created a React component that generates a list of tasks. Currently, the code works fine with this.props.data, and if the data is empty, no tasks are displayed. My goal is to modify the code so that if the array is empty, a simple text message ...