I am working on a Vue 3 application that uses Pinia for state management and Parse as a backend service. The issue I am encountering involves the initialization of Parse and its subsequent use in a Pinia store. I am relatively new to Vue/Parse and this is my first time attempting to use Pinia. I am expecting that the issue comes from my understanding of the lifecycle of Vue applications
In my main.js file, I am initializing Parse like this:
const APPLICATION_ID = '######################################';
const JS_Key = '#######################################';
Parse.serverURL = 'https://###############';
console.log("Initializing Parse");
Parse.initialize(APPLICATION_ID, JS_Key);
console.log("Parse Initialized");
I have previously used Parse to retrieve information from my database and everything worked fine when I was using parse to retrieve information effectively on button press. However I am now attempting to load information on application start as it is information I would like to have available globally in my application using Pinia.
Originally, I attempted to make the calls to load this information in my App.vue since I wanted to have it globally across my application and at application start. However I moved past this as it was giving me an initialization error. Now I loading the information inside my homePage.vue which the user reaches once they log in. However I am still getting errors that my Parse is not initialized. My file structure is as follows:
src
srcassets
srccomponents
srccomponentshomePage.vue
srcstores
srcstoresuseCharacterStore.js
srcApp.vue
srcmain.js
Inside useCharacterStore is where I am getting my errors claiming Parse is not initialized. If more code is required to determine what the problem is please let me know. I am hoping that it is more so surrounding the Vue lifecycle and I just need to it explained differently than what was stated in the documentation.