\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\nlet event2 = null\r\nevent2.dummy\r\n\u003C/script>\r\n```\r\n\r\nI get the following error.\r\n`Cannot read properties of null (reading 'dummy')`\r\n\r\nconsole works with v3.3.2 but not after v3.3.3.\r\nWhen testing, Vue version is fixed to v3.3.4.\r\n\r\n### Additional context\r\n\r\n\r\n\r\nsimilar issue #20347\r\n\r\n### Logs\r\n\r\n_No response_",[2940,2943,2944,2947],{"name":2941,"color":2942},"workaround available","11376d",{"name":2923,"color":2924},{"name":2945,"color":2946},"🔨 p3-minor","FBCA04",{"name":2948,"color":2949},"✨ good reproduction","fbca04",22691,"nuxtApp.vueApp.config.errorHandler doesn't work","2024-11-19T16:20:54Z","https://github.com/nuxt/nuxt/issues/22691",0.66086084,{"description":2956,"labels":2957,"number":2961,"owner":2913,"repository":2913,"state":2914,"title":2962,"updated_at":2963,"url":2964,"score":2965},"### Environment\n\n- Operating System: Linux\r\n- Node Version: v16.20.0\r\n- Nuxt Version: 3.6.5\r\n- Nitro Version: 2.5.2\r\n- Package Manager: npm@9.4.2\r\n- Builder: vite\r\n- User Config: ssr\r\n- Runtime Modules: -\r\n- Build Modules: -\n\n### Reproduction\n\nReproduction link: [https://stackblitz.com/edit/github-eykmgq?file=app.vue](https://stackblitz.com/edit/github-eykmgq?file=app.vue) Please check console logs.\r\n\r\n1. get error from useFetch\r\n2. watch status and on error check if error.value is instanceof `FetchError`\r\n3. get true\r\n4. get error from awaited useFetch\r\n5. check if error.value is instanceof `FetchError`\r\n6. get false\n\n### Describe the bug\n\nError returned from useFetch has different instanceof FetchError value depending if useFetch is awaited. For awaited useFetch it's strangely `false`\n\n### Additional context\n\nPlease note that I'm using nuxt with `ssr: false` config option\n\n### Logs\n\n_No response_",[2958],{"name":2959,"color":2960},"pending triage","E99695",22753,"Error returned from useFetch has different instanceof FetchError value depending if useFetch is awaited","2024-06-30T11:07:53Z","https://github.com/nuxt/nuxt/issues/22753",0.6656902,{"description":2967,"labels":2968,"number":2973,"owner":2913,"repository":2913,"state":2974,"title":2975,"updated_at":2976,"url":2977,"score":2978},"### Environment\r\n\r\n- Operating System: Linux\r\n- Node Version: v18.15.0\r\n- Nuxt Version: 3.6.2\r\n- Nitro Version: 2.5.2\r\n- Package Manager: yarn@1.22.19\r\n- Builder: vite\r\n- User Config: typescript, app, modules, nitro, runtimeConfig, css, vue, build, imports, pinia, piniaPersistedstate, i18n, devtools\r\n- Runtime Modules: @pinia/nuxt@0.4.11, @pinia-plugin-persistedstate/nuxt@1.1.1, @nuxtjs/i18n@8.0.0-beta.13, @unocss/nuxt@0.53.5, @vueuse/nuxt@10.2.1, @nuxtjs/device@3.1.0, @nuxt/content@2.7.0\r\n- Build Modules: -\r\n\r\n### Reproduction\r\n\r\n```\r\n// plugins/hook.ts\r\n// code from doc's example\r\nexport default defineNuxtPlugin((nuxtApp) => {\r\n nuxtApp.hook('vue:error', (..._args) => {\r\n console.log('vue:error')\r\n // if (process.client) {\r\n // console.log(..._args)\r\n // }\r\n })\r\n nuxtApp.hook('app:error', (..._args) => {\r\n console.log('app:error')\r\n // if (process.client) {\r\n // console.log(..._args)\r\n // }\r\n })\r\n nuxtApp.vueApp.config.errorHandler = (..._args) => {\r\n console.log('global error handler')\r\n // if (process.client) {\r\n // console.log(..._args)\r\n // }\r\n }\r\n})\r\n```\r\n\r\n```\r\n// server/api/someapi/index.get.ts\r\nexport default defineEventHandler(async (event) => {\r\n const data = getSomeData()\r\n if (!data)\r\n throw createError({statusCode: 404, statusMessage: 'errors.404_notfound'})\r\n})\r\n```\r\n\r\n```\r\nerror message from console:\r\nUncaught (in promise) Error: errors.404_notfound\r\n```\r\n\r\n```\r\n// layout/alert.vue\r\n\u003Ctemplate>\r\n \u003Cdiv>\r\n $t('some error messages')\r\n \u003C/div>\r\n\u003C/template>\r\n```\r\n\r\n### Describe the bug\r\n\r\nI want to popup error message when error occurs,\r\nand was hoping nuxt hook would catch all the errors created by createError(),\r\nso I can place popup alert function inside nuxt hook,\r\nbut it doesn't catch anything.\r\n\r\nI have alert function ready for successful / failed api result,\r\njust don't know how I can globally catch errors and handle them.\r\n\r\nI don't want to render a full page of error and let user go back by using clearError,\r\nI just want to simply catch it and show them what's wrong\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2969,2972],{"name":2970,"color":2971},"3.x","29bc7f",{"name":2959,"color":2960},22109,"closed","error hook not catching errors?","2024-01-26T10:52:58Z","https://github.com/nuxt/nuxt/issues/22109",0.61824083,{"description":2980,"labels":2981,"number":2986,"owner":2913,"repository":2913,"state":2974,"title":2987,"updated_at":2988,"url":2989,"score":2990},"Fetch errors do not bail rendering and are only available via `$fetchState.error`. This makes it hard when we want to report them to a logging system (nuxt-community/sentry-module#245) or having any global behavior like showing an alert or failing rendering. \r\n\r\nWe can introduce a runtime hook like `fetchError` to allow this. It is possible to use vue events on `$root` instance to `$emit` and listen with `$on`. Only problem is that nuxt plugins are getting called before it creates so we need to introduce `ctx.$on` utility that gathers listeners and registers them when instance created.\r\n\r\nAlternative approach: (#8475 / cc @Atinux) We can throw fetch errors. But this means introducing a breaking change (and not sure if it works universally same)",[2982,2983],{"name":2907,"color":2908},{"name":2984,"color":2985},"2.x","d4c5f9",8786,"hook on fetch errors","2024-06-14T16:02:38Z","https://github.com/nuxt/nuxt/issues/8786",0.62233406,{"description":2904,"labels":2992,"number":2993,"owner":2913,"repository":2913,"state":2974,"title":2915,"updated_at":2994,"url":2995,"score":2996},[],15829,"2023-01-20T14:16:03Z","https://github.com/nuxt/nuxt/issues/15829",0.6350538,{"labels":2998,"number":3003,"owner":2913,"repository":2913,"state":2974,"title":3004,"updated_at":3005,"url":3006,"score":3007},[2999,3001,3002],{"name":3000,"color":2930},"stale",{"name":2959,"color":2960},{"name":2984,"color":2985},8231,"errorCaptured not catching error throwed in fetch hook","2023-01-22T15:38:17Z","https://github.com/nuxt/nuxt/issues/8231",0.6387581,{"description":3009,"labels":3010,"number":3012,"owner":2913,"repository":2913,"state":2974,"title":3013,"updated_at":3014,"url":3015,"score":3016},"### What problem does this feature solve?\n\nThe new fetch-hook uses a global try/catch in the nuxt core, and exposes the error only as a property inside `$fetchState.error`. Upstream, the error is now also emitted to the console on dev enviroments by default.\n\nFor production environments, currently the `$fetchState.error` can easily be used to handle errors in per component by checking for `$fetchState.error` in the component. However, there is no API available to have any sort of generic error reporting for any fetch-hook in the app.\n\nHowever, for integrating with error-reporting tools like Bugsnag or Sentry, I'd want to be able to easily report any exceptions from *any* fetch-hook inside the App.\n\nIt would be great if there was a hook here we could use to add a specific implementation for Bugsnag, Sentry or another tool to any $fetch hook used in the app, while retaining the graceful error handling that's there now.\n\n### What does the proposed changes look like?\n\nI don't really know how to implement hooks in the nuxt source, but I'd imagine the consumer API could look like this:\n\n```\nimport Bugsnag from 'bugsnag';\nthis.nuxt.hook('app:onFetchError', (app, err) => Bugsnag.notifyException(err));\n```\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This feature request is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c10773\">#c10773\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3011],{"name":2959,"color":2960},7517,"Allow hooking into $fetch (specifically for generic error reporting)","2025-06-05T13:37:21Z","https://github.com/nuxt/nuxt/issues/7517",0.64378995,{"description":3018,"labels":3019,"number":3022,"owner":2913,"repository":2913,"state":2974,"title":3023,"updated_at":3024,"url":3025,"score":3026},"### Version\n\n[v1.4.0](https://github.com/nuxt/nuxt.js/releases/tag/v1.4.0)\n\n### Reproduction link\n\n[https://glitch.com/edit/#!/jumpy-boat](https://glitch.com/edit/#!/jumpy-boat)\n\n### Steps to reproduce\n\nIts a must have for error reporting with tools like bugsnag, sentry etc. They register error handlers for Vue.config.errorHandler but this doesnt get triggered for some reason when error get happened inside fetch/asyncData, maybe in some other nuxt methods dont know.\nThis error wont be catched. It also wont be catched by general js script error catcher in bugsnag, nuxt will process it itself and show a error page.\nSo basically this errors will be lost \nIf it happens on SSR it can be catched via render:errorMiddleware hook. But it dont work for client.\nSame happens in latest edge version.\n\n### What is expected ?\n\nErrors trigger errorHandler as in mount\n\n### What is actually happening?\n\nNothing get triggered, error got eaten by nuxt.\n\n### Additional comments?\n\nAny workaround?\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This bug report is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c7070\">#c7070\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3020,3021],{"name":2959,"color":2960},{"name":2984,"color":2985},3335,"Catch error in fetch/asyncData methods for error reporting with Vue.config.errorHandler dont work","2023-01-22T15:30:04Z","https://github.com/nuxt/nuxt/issues/3335",0.64574784,["Reactive",3028],{},["Set"],["ShallowReactive",3031],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fyHyXJRzKvd4ZyePXviOAoM9n2AiHu1WNDrRxXUYr25A":-1},"/nuxt/nuxt/27493"]