When attempting to register a global filter in Vue3
, an error is being raised:
main.js?56d7:13 Uncaught TypeError: Cannot read property 'globalProperties' of undefined
Despite referencing the solution provided in Use filter in Vue3 but can't read globalProperties, the issue persists.
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/tailwind.css";
import axiosSetUp from "@/auth/axiosSetUp";
import {formatIsoDateTime as utils_formatIsoDateTime} from "@/utils";
axiosSetUp()
const app = createApp(App).use(store).use(router).mount("#app");
app.config.globalProperties.$filters = {
formatIsoDateTime(isoString) {
return utils_formatIsoDateTime(isoString)
}
}
Any insights on where the problem might be located?