I'm creati an error reporting service, and trying to provide it for the entire app.
import ErrorReporter from "@/services/error_reporter/error-reporter.service";
const app = createApp(App);
app.provide('errorReporter', new ErrorReporter());
and the importing it in a Ts class like so
import {inject} from "vue";
export default class OAuthFedIdService {
errorReporter: ErrorReporter = inject("errorReporter") as ErrorReporter;
but i get this warning inside the console
inject() can only be used inside setup() or functional components.
is there a way to use the provide/inject functionality of Vue outside of components without getting warnings?