\r\n\u003C/template>\r\n``` \r\n\r\nBy the way, [the doc state](https://ui.nuxt.com/getting-started/theming#ui-prop) that \"Each component has a ui prop\". Which is not true then.\n\n### Additional context\n\n_No response_",[2030,2031],{"name":1985,"color":1986},{"name":2005,"color":2006},2094,"Some component doesn't have a UI prop","2025-03-17T14:27:40Z","https://github.com/nuxt/ui/issues/2094",0.7131326,{"description":2038,"labels":2039,"number":2041,"owner":1991,"repository":1991,"state":2022,"title":2042,"updated_at":2043,"url":2044,"score":2045},"This is my koa app that serves nuxt app.\r\n* if NODE_ENV=production it always serves \"OK\" and nothing happens on server\r\n* if NODE_ENV=development it always serves \"OK\" and in server logs I see that app fetches async data and then there is error `UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Can't set headers after they are sent.`\r\n* it works with express\r\n\r\n```js\r\nimport Koa from 'koa'\r\nimport { Nuxt, Builder } from 'nuxt'\r\nimport config from './../nuxt.config.js'\r\n\r\nconst app = new Koa()\r\n\r\nconfig.dev = !(process.env.NODE_ENV === 'production')\r\n\r\nconst nuxt = new Nuxt(config)\r\n\r\nif (config.dev) {\r\n const builder = new Builder(nuxt)\r\n builder.build()\r\n}\r\n\r\napp.use(async (ctx, next) => {\r\n ctx.status = 200\r\n await nuxt.render(ctx.req, ctx.res)\r\n})\r\n\r\napp.listen(3000)\r\nconsole.log('Server listening')\r\n```\r\n\r\nNote that following piece of code is exactly the same I used with nuxt 1.0.0-alpha.4\r\n\r\n```js\r\napp.use(async (ctx, next) => {\r\n ctx.status = 200\r\n await nuxt.render(ctx.req, ctx.res)\r\n})\r\n```\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1063\">#c1063\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2040],{"name":2019,"color":2020},1206,"programatic usage with koa fails since migration from 1.0.0-alpha.4 to v1.0.0-rc3","2023-01-18T15:40:55Z","https://github.com/nuxt/nuxt/issues/1206",0.7258961,{"description":2047,"labels":2048,"number":2053,"owner":1991,"repository":1991,"state":2022,"title":2054,"updated_at":2055,"url":2056,"score":2057},"\"nuxt\": \"^2.14.12\"\r\n\r\nIf I use sync code, serverMiddleware runs correctly.\r\nBut meets async/await code, koa returns directly in serverMiddleware.\r\nI also test this with koa alone, async/await is supported.\r\n\r\nmy code is below:\r\n```js\r\n//server-middleware/index.js\r\nimport Koa from 'koa'\r\nimport Router from 'koa-router'\r\nconst router = new Router()\r\nconst app = new Koa()\r\nconst apiRouter = require('./routers') // API接口路由\r\n\r\nrouter.use(async (ctx, next) => {\r\n await console.log('in router use')\r\n next()\r\n})\r\n\r\nrouter.use(apiRouter.routes()).use(apiRouter.allowedMethods())\r\napp.use(router.routes()).use(router.allowedMethods())\r\nexport default {\r\n path: '/api/v1/server-middleware',\r\n handler: app.callback()\r\n}\r\n```\r\n\r\n```js\r\n//server-middleware/routers/index.js\r\nconst Router = require('koa-router')\r\n\r\nconst router = new Router({\r\n prefix: '/business'\r\n})\r\n\r\nrouter.get('/article', async (ctx, next) => {\r\n debugger\r\n // await console.log('in server middleware get:/business/article')\r\n await timer() //\u003C------------------------------bug here-----------------------------------\r\n ctx.response.status = 200\r\n ctx.response.type = 'application/json'\r\n // const data = await { code: 20000, data: { goods: 1 }, message: '' }\r\n ctx.response.body = Object.assign({}, { code: 20000, data: { goods: 2 } })\r\n})\r\n\r\nfunction timer() {\r\n return new Promise(resolve => {\r\n setTimeout(function () {\r\n resolve()\r\n }, 3000)\r\n })\r\n}\r\nmodule.exports = router\r\n```\r\n\r\ncurl http://localhost:3000/api/v1/server-middleware/business/article\r\nThe bug is in code: `await timer()`:\r\nKoa middleware returns without waitting for 3 seconds, it goes to `next() in router.use()` in `server-middleware/index.js`.\r\nThe left code in middleware `router.get('/article'` continus running after 3s, but the request has already been returned.",[2049,2052],{"name":2050,"color":2051},"question","cc317c",{"name":2019,"color":2020},8952,"serverMiddleware does not support async/await with Koa?","2023-01-18T15:30:23Z","https://github.com/nuxt/nuxt/issues/8952",0.7289562,{"description":2059,"labels":2060,"number":2062,"owner":1991,"repository":1991,"state":2022,"title":2063,"updated_at":2064,"url":2065,"score":2066},"Bypassing Koa's response handling is not supported. Avoid using the following node properties:\r\n\r\nres.statusCode\r\nres.writeHead()\r\nres.write()\r\nres.end()\r\n\r\nbut \r\n\r\nserver.js 40 line\r\ncontext.res.writeHead(opts.status, {\r\n 'Location': opts.path\r\n })\r\n context.res.end()\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1126\">#c1126\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2061],{"name":2019,"color":2020},1277,"Bypassing Koa's response handling is not supported. Avoid using the following node properties res.writeHead()","2023-01-18T15:41:00Z","https://github.com/nuxt/nuxt/issues/1277",0.733475,{"description":2068,"labels":2069,"number":2074,"owner":1991,"repository":2008,"state":2022,"title":2075,"updated_at":2076,"url":2077,"score":2078},"### Environment\n\n- Operating System: Windows_NT\n- Node Version: v18.20.4\n- Nuxt Version: 3.13.2\n- CLI Version: 3.15.0\n- Nitro Version: 2.9.7\n- Package Manager: npm@10.7.0\n- Builder: -\n- User Config: default\n- Runtime Modules: @nuxt/ui@2.18.7\n- Build Modules: -\n\n### Version\n\nv3\n\n### Reproduction\n\nCreat new project with nuxi\n\nInstall nuxt/ui\n\n### Description\n\nCannot destructure property 'nuxt' of 'this' as it is undefined.\n\nNot working on fresh project\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2070,2071],{"name":2002,"color":2003},{"name":2072,"color":2073},"v3","49DCB8",2442,"Cannot destructure property 'nuxt' of 'this' as it is undefined.","2024-10-23T20:22:23Z","https://github.com/nuxt/ui/issues/2442",0.73431116,{"description":2080,"labels":2081,"number":2089,"owner":1991,"repository":2008,"state":2022,"title":2090,"updated_at":2091,"url":2092,"score":2093},"### Environment\n\n Operating System: Darwin\r\n- Node Version: v20.12.2\r\n- Nuxt Version: 3.11.2\r\n- CLI Version: 3.11.1\r\n- Nitro Version: 2.9.6\r\n- Package Manager: npm@10.5.0\r\n- Builder: -\r\n- User Config: routeRules, app, runtimeConfig, nitro, css, devtools, experimental, auth, mongoose, pinia, vueEmail, googleFonts, modules\r\n- Runtime Modules: @nuxt/image@1.7.0, @vueuse/nuxt@10.9.0, nuxt-mongoose@1.0.5, @pinia/nuxt@0.5.1, @pinia-plugin-persistedstate/nuxt@1.2.0, @nuxt/content@2.12.1, @sidebase/nuxt-auth@0.7.2, @vue-email/nuxt@0.8.19, nuxt-aos@1.2.4, @nuxt/ui@2.16.0, @nuxtjs/google-fonts@3.2.0\r\n- Build Modules: -\n\n### Version\n\nv2.16.0\n\n### Reproduction\n\nnothing there\n\n### Description\n\n- activeClass does not work on UButton when switching from another layout, activeClass starts working when you reload the page. \r\n- If I use NuxtLink everything works fine.\r\n\r\n> I have layout auth on the registration page, after authorization I am automatically redirected to the page with the default layout, on this page there is a menu with a UButtons\r\n\r\n----\r\nScreenshot don't work\r\n\r\nScreenshot normal work\r\n\r\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2082,2083,2086],{"name":2002,"color":2003},{"name":2084,"color":2085},"needs reproduction","CB47CF",{"name":2087,"color":2088},"closed-by-bot","ededed",1778,"UButton - activeClass does not work when switching from another layout","2025-04-01T02:12:03Z","https://github.com/nuxt/ui/issues/1778",0.7353103,{"description":2095,"labels":2096,"number":2099,"owner":1991,"repository":2100,"state":2022,"title":2101,"updated_at":2102,"url":2103,"score":2104},"http://localhost:3000/integrations?version=2.x\n\n",[2097],{"name":2002,"color":2098},"ff281a",549,"nuxt.com","[Integrations] Version selector is not valid on refresh with query param","2023-02-15T12:32:31Z","https://github.com/nuxt/nuxt.com/issues/549",0.7355414,["Reactive",2106],{},["Set"],["ShallowReactive",2109],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"1cUwnd1ca6CpPhCzDSkXE75gJm1MBwsZ9XRXCLVPjMk":-1},"/nuxt/ui/3094"]