\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_",[2021,2024,2027,2030],{"name":2022,"color":2023},"workaround available","11376d",{"name":2025,"color":2026},"bug","d73a4a",{"name":2028,"color":2029},"🔨 p3-minor","FBCA04",{"name":2031,"color":2032},"✨ good reproduction","fbca04",22691,"nuxtApp.vueApp.config.errorHandler doesn't work","2024-11-19T16:20:54Z","https://github.com/nuxt/nuxt/issues/22691",0.65584904,{"description":2039,"labels":2040,"number":2045,"owner":1991,"repository":1991,"state":2046,"title":2047,"updated_at":2048,"url":2049,"score":2050},"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)",[2041,2042],{"name":1985,"color":1986},{"name":2043,"color":2044},"2.x","d4c5f9",8786,"closed","hook on fetch errors","2024-06-14T16:02:38Z","https://github.com/nuxt/nuxt/issues/8786",0.6130091,{"description":2052,"labels":2053,"number":2058,"owner":1991,"repository":1991,"state":2046,"title":2059,"updated_at":2060,"url":2061,"score":2062},"### 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_",[2054,2057],{"name":2055,"color":2056},"3.x","29bc7f",{"name":2002,"color":2003},22109,"error hook not catching errors?","2024-01-26T10:52:58Z","https://github.com/nuxt/nuxt/issues/22109",0.61465335,{"description":1982,"labels":2064,"number":2065,"owner":1991,"repository":1991,"state":2046,"title":1993,"updated_at":2066,"url":2067,"score":2068},[],15829,"2023-01-20T14:16:03Z","https://github.com/nuxt/nuxt/issues/15829",0.6297901,{"description":2070,"labels":2071,"number":2074,"owner":1991,"repository":1991,"state":2046,"title":2075,"updated_at":2076,"url":2077,"score":2078},"### Environment\r\n\r\nNuxt project info:\r\n\r\n------------------------------\r\n- Operating System: `Windows_NT`\r\n- Node Version: `v16.13.1`\r\n- Nuxt Version: `3.0.0-rc.11`\r\n- Nitro Version: `0.5.4`\r\n- Package Manager: `npm@8.5.2`\r\n- Builder: `vite`\r\n- User Config: `-`\r\n- Runtime Modules: `-`\r\n- Build Modules: `-`\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\n```vue\r\n\u003Cscript lang=\"ts\" setup>\r\nimport axios from 'axios'\r\n\r\nconst props = defineProps({\r\n image: {\r\n type: String\r\n }\r\n})\r\n\r\nconst isExist = ref(false)\r\n\r\nconst isFileExist = async (filepath: string) => {\r\n try {\r\n await $fetch(filepath)\r\n return true\r\n } catch (e) {\r\n return false\r\n }\r\n}\r\n\r\nonMounted(async () => {\r\n isExist.value = await isFileExist(props.image)\r\n})\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cimg :src=\"isExist ? image ? '../assets/images/default.jpg'\" />\r\n\u003C/template>\r\n```\r\n\r\n### Describe the bug\r\n\r\nHello everyone ! I want to make a function that check if an image exist in my project folder. My function works but when I use try catch statement, I have error 404 (when image is not found) display on the console. I want to catch this error with my catch sattement but it doesn't work.\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2072,2073],{"name":2055,"color":2056},{"name":2002,"color":2003},15077,"Cannot catch error with $fetch (ohmyfetch)","2023-01-19T17:44:36Z","https://github.com/nuxt/nuxt/issues/15077",0.6421116,{"labels":2080,"number":2086,"owner":1991,"repository":1991,"state":2046,"title":2087,"updated_at":2088,"url":2089,"score":2090},[2081,2084,2085],{"name":2082,"color":2083},"stale","ffffff",{"name":2002,"color":2003},{"name":2043,"color":2044},8231,"errorCaptured not catching error throwed in fetch hook","2023-01-22T15:38:17Z","https://github.com/nuxt/nuxt/issues/8231",0.6438106,{"description":2092,"labels":2093,"number":2096,"owner":1991,"repository":1991,"state":2046,"title":2097,"updated_at":2098,"url":2099,"score":2100},"### 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>",[2094,2095],{"name":2002,"color":2003},{"name":2043,"color":2044},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.6442377,["Reactive",2102],{},["Set"],["ShallowReactive",2105],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"yHyXJRzKvd4ZyePXviOAoM9n2AiHu1WNDrRxXUYr25A":-1},"/nuxt/nuxt/27493"]