© 2026 Hedgehog Software, LLC
app/plugins/app.ts
export type AppPlugin = { error(v: { code: string; error: any }): void } export default defineNuxtPlugin((nuxtApp) => { const appObject = { error(v) { // todo: make better error handling console.error(`[APP|ERROR] error at ${v.code}: ${v.error}`) }, } as AppPlugin nuxtApp.provide('app', appObject) })
unknown
import type { AppPlugin } from '../plugins/app' import type { ApolloClient } from '@apollo/client/core' declare module '#app' { interface NuxtApp { $app: AppPlugin $apollo: ApolloClient } }
Join the Discord to ask follow-up questions and connect with the community
Nuxt Community Chat Server
31,632 Members