The Vuex commit has exceeded the maximum calstack size limit

Currently facing an issue

https://i.sstatic.net/l1WWH.png

The error seems to be isolated to this specific section

  mounted() {
    this.$nextTick(() => {
      let ctx = this.$refs.canvas.getContext('2d')
      let { chartType, dataOptions } = this.module
      this.chart = new Chart(ctx, {
        type: chartType,
        data: dataOptions,
        options: minimizeOptions,
      })
    })
  },

The error is originating from dataOptions. If I set data to {}, everything functions properly, but then my chart lacks data.

this.module is a prop passed to my component. The component is rendered in a v-for loop

    <module
      v-for="mod in modules"
      :module="mod"
      :key="mod._id.toString()"
    />

Using Chart.js for this implementation.

Struggling to identify the cause of the call stack exceed error.

Wondering if anyone else has encountered similar issues?

It is worth mentioning that the error occurs when attempting to toggle a global component within a layout layout

dataOptions:

{
   datasets: [
      {
          backgroundColor: "#34495e",
          borderColor: "bdc3c7",
          data: [0],
          label: "My first dataset"
      }
   ],
   labels: ["Start"]
}

Answer №1

I don't actually need reactivity on this prop, so I opted to freeze it.

  let { chartType, dataOptions } = Object.freeze(this.module);

Reactivity is now gone and the error as well. This resolved my issue.

If anyone has a solution for reactive data, please share.

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

Prevent Vuetify dropdown v-menu with submenu from closing upon selection

Dealing with a Vuetify issue related to submenus in a dropdown menu. Everything is functioning correctly, except for the main dropdown menu not closing when clicking on a submenu item. The submenu closes properly. 1. Dropdown menu opens on click 2. Submenu ...

What is the correct method for configuring access permissions?

I'm in the process of developing a user management system, but I keep finding myself having to check the user type for each router. router.get('/admin/settings', (req, res) => { if(admin) { //Proceed. } } router.get(&apo ...

ways to display view without page refresh in mvc3

@using (Html.BeginForm("Index", "HRBankInfo", FormMethod.Get)) { <div align="center" class="display-label"> @ViewBag.message <br /><input type="submit" value="Ok" /> </div> } This particular partial view is display ...

How can one effectively eliminate redundant duplicates from an object in Javascript?

Review the JavaScript object provided below (note that only a portion of the object is shown). https://i.sstatic.net/5H0gn.png Here is the requirement: For each distinct user, limit the number of random leads to a maximum of 4 and discard the rest. For ...

Error with setting innerHTML property of a null nested div

This issue arises when the element is referenced before the DOM has completely loaded. To combat this, I have ensured that the necessary script runs only after the window has finished loading. Interestingly, if the getElementById() call is for a standalon ...

Creating, editing, and deleting data in Ng2 smart table is a seamless process that can greatly enhance

While working on my Angular 2 project, I utilized [ng2 smart table]. My goal was to send an API request using the http.post() method. However, upon clicking the button to confirm the data, I encountered the following error in the console: ERROR TypeErro ...

Executing a node.js function within an Angular 2 application

Currently, I am running an Angular2 application on http://localhost:4200/. Within this app, I am attempting to call a function located in a separate node.js application that is running on http://localhost:3000/. This is the function call from my Angular2 ...

Accordion is having trouble expanding fully

My accordion is causing some trouble. When I try to open one section, both sections end up opening. I want it to toggle, so that only one section opens at a time based on my click. Switching the display from flex to column fixes the issue, but I don' ...

How do I access a specific child from an object/element retrieved by using the elementFromPoint() method in Javascript?

Is there a method to extract the child element from an element or object retrieved by the function elementFromPoint(x, y); Consider the following scenario: var elem = document.elementFromPoint(x, y); Let's assume that the element returned and saved ...

Utilizing X-editable in an ASP MVC View: navigating the form POST action to the controller

I have been utilizing the X-Editable Plugin to collect user input and perform server submissions. However, I am encountering an error during submission. What adjustments should I make in order to ensure that the x-editable data functions properly with the ...

Redirecting in Next.js without the use of a React component on the page

I need to redirect a page using HTTP programmatically only. The following code achieves this: export const getServerSideProps: GetServerSideProps = async (context) => { return { redirect: { destination: '/', permanent: false, ...

How can I incorporate the `name` parameter into a `redirect` URL using vue-router?

Below is the setup of my router in the Vue project import { createRouter, createWebHistory } from "vue-router"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: "/", ...

Utilizing React and Material-UI to create an autocomplete feature for words within sentences that are not the first word

Looking to enable hashtag autocomplete on my webapp, where typing #h would display a menu with options like #hello, #hope, etc. Since I'm using material-ui extensively within the app, it would be convenient to utilize the autocomplete component for th ...

What could be causing my Ionic button to not initialize in the expected state while using ngIf with a boolean property connected to an Ionic checkbox?

I'm currently in the process of setting up a list of ingredients with checkboxes and conditional buttons, but I'm facing some challenges with the default state. Ideally, I only want the button to be visible when the checkbox is unchecked so that ...

When working with Next.js Components, be aware that using a return statement in a forbidden context can lead to

Whenever I try to add a new component to my Next.js project, I encounter an error that displays the following: `./components/GridMember.js Error: error: Return statement is not allowed here | 6 | return (test); | ^^^^^^^^^^^^^^^^^^^^^^^^^ Caused ...

Utilizing FontAwsome Icons within a CSS2DObject using VueJS

As an aspiring coder, I am determined to display a FontAwsome User Icon similar to the example here within a VueJS component. I have diligently attempted to replicate the same example showcased in this codesandbox, exploring the two approaches recommended ...

"Retrieve and transfer image data from a web browser to Python's memory with the help

Is there a way to transfer images from a browser directly into Python memory without having to re-download them using urllib? The images are already loaded in the browser and have links associated with them. I want to avoid downloading them again and ins ...

The ReactJS Application Cache Client fails to display the most recent updates

One issue I'm currently facing is with my application in production. Some clients have reported that they are unable to see the new changes unless they clear their cache completely. Using Techs: React Any suggestions on what steps I should take to a ...

What is the best way to reference a JavaScript or jQuery variable within a PHP variable?

Is it possible to read a javascript or jquery variable through php code? For example: <script> var num = 3; </script> <php? $a = 20; $b = num*$a; // Is this valid? ?> Any thoughts on this? ...

Updating the state of an array containing objects within an array of objects in React

I have a state called invoices, which is an array of objects structured like this: const [invoices, setInvoices] = useState([ { id: 123, tag_number: "", item_amounts: [ { item: "processing", amount: 159 }, { i ...