First time using Pinia and I'm not a professional developer. Anyway, I defined two stores (XLSXFiles.js contains data loaded from XLSX files, and DAG.js contains an acyclic binary tree). In the 'actions' section of DAG.js, I defined 'initializeTempIndividual' which shall iteratively populate the object 'tempIndividual' with data from a given line of the array 'mappedData[]'. On the first call, the parameter 'index' is set to 0.
init() {
this.XLSXfilesInstance = useXLSXfilesStore()
},
initializeTempIndividual(index) {
const recordInXLSX = this.XLSXfilesInstance.mappedData[index]
this.tempIndividual = {
indexInTable: index,
/* Here is the definition of XLSXfiles.js */
import { defineStore } from 'pinia'
export const useXLSXfilesStore = defineStore('XLSXfiles' /* the unique ID */, {
state() {
return {
mappedData: [], // Evénements dans le fichier XLSX
As a result, I get a 'mappedData[index] is undefined' error while I'm still able to output in the console 'this.XLSXfilesInstance.mappedData' which is, as expected, an Array containing the correct data. I'm totally confused.