\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript lang=\"ts\" setup>\r\n type Conversation = {\r\n id: string\r\n roomId: string\r\n state: 'read' | 'unread'\r\n user?: User | null\r\n message?: string\r\n messages?: Message[]\r\n role: 'client' | 'admin'\r\n createdAt: string\r\n updatedAt?: string\r\n }\r\n\r\n const conversations = useState\u003CConversation[]>('conversations', () => [])\r\n\u003C/script>\r\n```\r\n\r\n`tsconfig.json`\r\n\r\n```json\r\n{\r\n \"extends\": \"./.nuxt/tsconfig.json\"\r\n}\r\n```\n\n### Describe the bug\n\nThe type of this `useState` is not good interpreted in the template block: \r\n\r\n\r\n\r\n\r\n\r\nThe bug is not present if I use a `ref` instead of `useState`.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2979,2980,2981,2982],{"name":2899,"color":2900},{"name":2956,"color":2957},{"name":2888,"color":2889},{"name":2983,"color":2909},"needs reproduction",24591,"Typescript error: useState have the wrong type in \u003Ctemplate /> block in VsCode.","2023-12-14T20:18:32Z","https://github.com/nuxt/nuxt/issues/24591",0.70896465,{"description":2990,"labels":2991,"number":2996,"owner":2877,"repository":2877,"state":2938,"title":2997,"updated_at":2998,"url":2999,"score":3000},"### Environment\n\nStackblitz + WSL\r\n\r\nWSL Info: \r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.17.1\r\n- Nuxt Version: 3.6.5\r\n- Nitro Version: 2.5.2\r\n- Package Manager: npm@9.8.1\r\n- Builder: vite\r\n- User Config: devtools, typescript, modules, components, graphqlMiddleware, css, postcss, runtimeConfig, app, routeRules\r\n- Runtime Modules: @nuxt/image@1.0.0-rc.1, nuxt-graphql-middleware@4.0.0-beta.3\r\n- Build Modules: -\r\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-gscpb2?file=server%2Fapi%2Fhello.ts\n\n### Describe the bug\n\nPassing the event to useRuntimeConfig in server API routes causes typechecking to fail, despite being [encouraged in the docs](https://nuxt.com/docs/guide/going-further/runtime-config#server-routes)\r\n\r\n\r\n1. Create an API route that uses `useRuntimeConfig(event)`\r\n2. Run `npx nuxi typecheck` (or similar) \r\n3. Will fail with `Expected 0 arguments, but got 1.`\r\n\r\nNote that stackblitz flags this as an error right in the editor too. \r\n\r\n\n\n### Additional context\n\n1. ESLint + VS Code's internal typescript seem to be able to narrow the right type. (Clicking \"Jump to Type Definition\" navigates to the right type which accepts events). I'm not sure why typechecking is failing there. \n\n### Logs\n\n```shell-script\nerror TS2554: Expected 0 arguments, but got 1.\r\n\r\nconst { apiUrl } = useRuntimeConfig(event);\r\n \r\n```\n```\n",[2992,2993,2994,2995],{"name":2899,"color":2900},{"name":2956,"color":2957},{"name":2902,"color":2903},{"name":2908,"color":2909},24095,"API endpoints useRuntimeConfig(event) throws type errors with nuxt typecheck","2024-02-09T12:16:29Z","https://github.com/nuxt/nuxt/issues/24095",0.7105079,["Reactive",3002],{},["Set"],["ShallowReactive",3005],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fXPzpU4gdcOwYP405GcXf9E4qgBaA7rnjrZm70UagKCw":-1},"/nuxt/ui/2103"]