[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79AFMY7J62PW6Y43GXM3265":3,"skill-same:01M79AFMY7J62PW6Y43GXM3265":103},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":14,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":58,"install":59,"resources":72},"01M79AFMY7J62PW6Y43GXM3265","nuxt-production",null,"| Nuxt 5 production optimization: hydration, performance, testing with Vitest, deployment to Cloudflare\u002FVercel\u002FNetlify, and migration from Nuxt 4. Use when: debugging hydration mismatches, optimizing performance and Core Web Vitals, writing tests with Vitest, deploying to Cloudflare Pages\u002FWorkers\u002FVercel\u002FNetlify, or migrating from Nuxt 4 to Nuxt 5.","Elogic360\u002Fsoftware-factory","Elogic360","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156535519?v=4","01M74NH3F0RB13PWB7JZDE2V80","elogic360","01M74NH3FPC65082MDZVMFHDM3",0,"MIT","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nuxt-production\ndescription: \"| Nuxt 5 production optimization: hydration, performance, testing with Vitest, deployment to Cloudflare\u002FVercel\u002FNetlify, and migration from Nuxt 4. Use when: debugging hydration mismatches, optimizing performance and Core Web Vitals, writing tests with Vitest, deploying to Cloudflare Pages\u002FWorkers\u002FVercel\u002FNetlify, or migrating from Nuxt 4 to Nuxt 5.\"\nlicense: MIT\nmetadata:\n  version: 5.0.0\n  author: Claude Skills Maintainers\n  category: Framework\n  framework: Nuxt\n  framework-version: 5.x\n  last-verified: 2026-03-30\n  keywords:\n    - hydration\n    - hydration mismatch\n    - ClientOnly\n    - SSR\n    - performance\n    - lazy loading\n    - lazy hydration\n    - Vitest\n    - testing\n    - deployment\n    - Cloudflare Pages\n    - Cloudflare Workers\n    - Vercel\n    - Netlify\n    - NuxtHub\n    - migration\n    - Nuxt 4 to Nuxt 5\n    - Rolldown\n    - Vite 8\n    - Nitro v3\n    - comment placeholder\n---\n# Nuxt 5 Production Guide\n\nHydration, performance, testing, deployment, and migration patterns.\n\n## What's New in Nuxt 5\n\n### v5 Key Changes\n\n| Change | Nuxt 4 | Nuxt 5 |\n|--------|--------|--------|\n| Bundler | Vite 6 (esbuild + Rollup) | Vite 8 (Rolldown) |\n| Server engine | Nitro v2 | Nitro v3 (h3 v2) |\n| Server errors | `createError({statusCode})` | `HTTPError({status})` |\n| Client-only placeholder | Empty `\u003Cdiv>` | HTML comment node |\n| callHook | Always returns Promise | May return void |\n| clearNuxtState | Sets to `undefined` | Resets to initial default |\n| Page names | Auto-generated | Normalized to route names |\n| JSX support | Included by default | Optional (on-demand) |\n| externalVue | Configurable | Removed (always mocked) |\n\n### Client-Only Comment Placeholders (v5)\n\nClient-only components (`.client.vue` files and `createClientOnly()` wrappers) now render an HTML comment on the server instead of an empty `\u003Cdiv>`. This fixes scoped styles hydration issues.\n\n```vue\n\u003C!-- If you relied on the placeholder \u003Cdiv> for layout -->\n\u003CClientOnly>\n  \u003CMyComponent \u002F>\n  \u003Ctemplate #fallback>\n    \u003Cdiv class=\"placeholder\" style=\"min-height: 200px\">\u003C\u002Fdiv>\n  \u003C\u002Ftemplate>\n\u003C\u002FClientOnly>\n```\n\nTo revert to the old `\u003Cdiv>` behavior:\n\n```typescript\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  experimental: {\n    clientNodePlaceholder: false\n  }\n})\n```\n\n### Non-Async callHook (v5)\n\n`callHook` may now return `void` instead of always returning `Promise`. Always use `await`:\n\n```typescript\n\u002F\u002F WRONG\nnuxtApp.callHook('my:hook', data).then(() => { ... })\n\n\u002F\u002F CORRECT\nawait nuxtApp.callHook('my:hook', data)\n```\n\n## When to Load References\n\n**Load `references\u002Fhydration.md` when:**\n- Debugging \"Hydration node mismatch\" errors\n- Implementing ClientOnly components\n- Fixing non-deterministic rendering issues\n\n**Load `references\u002Fperformance.md` when:**\n- Optimizing Core Web Vitals scores\n- Implementing lazy loading and code splitting\n- Reducing bundle size\n\n**Load `references\u002Ftesting-vitest.md` when:**\n- Writing component tests with @nuxt\u002Ftest-utils\n- Testing composables with Nuxt context\n- Mocking Nuxt APIs\n\n**Load `references\u002Fdeployment-cloudflare.md` when:**\n- Deploying to Cloudflare Pages or Workers\n- Configuring wrangler.toml\n- Setting up NuxtHub integration\n\n## Hydration Best Practices\n\n### What Causes Hydration Mismatches\n\n| Cause | Example | Fix |\n|-------|---------|-----|\n| Non-deterministic values | `Math.random()` | Use `useState` |\n| Browser APIs on server | `window.innerWidth` | Use `onMounted` |\n| Date\u002Ftime on server | `new Date()` | Use `useState` or `ClientOnly` |\n| Third-party scripts | Analytics | Use `ClientOnly` |\n\n### Fix Patterns\n\n```vue\n\u003C!-- Non-deterministic values -->\n\u003Cscript setup>\nconst id = useState('random-id', () => Math.random())\n\u003C\u002Fscript>\n\n\u003C!-- Browser APIs -->\n\u003Cscript setup>\nconst width = ref(0)\nonMounted(() => {\n  width.value = window.innerWidth\n})\n\u003C\u002Fscript>\n\n\u003C!-- ClientOnly component -->\n\u003Ctemplate>\n  \u003CClientOnly>\n    \u003CMyMapComponent \u002F>\n    \u003Ctemplate #fallback>\n      \u003Cdiv class=\"skeleton\">Loading map...\u003C\u002Fdiv>\n    \u003C\u002Ftemplate>\n  \u003C\u002FClientOnly>\n\u003C\u002Ftemplate>\n```\n\n## Performance Optimization\n\n### Lazy Loading Components\n\n```vue\n\u003Cscript setup>\nconst HeavyChart = defineAsyncComponent(() =>\n  import('~\u002Fcomponents\u002FHeavyChart.vue')\n)\n\u003C\u002Fscript>\n```\n\n### Lazy Hydration\n\n```vue\n\u003Cscript setup>\nconst LazyComponent = defineLazyHydrationComponent(\n  'visible',\n  () => import('.\u002FHeavyComponent.vue')\n)\n\nconst InteractiveComponent = defineLazyHydrationComponent(\n  'interaction',\n  () => import('.\u002FInteractiveComponent.vue')\n)\n\nconst IdleComponent = defineLazyHydrationComponent(\n  'idle',\n  () => import('.\u002FIdleComponent.vue')\n)\n\u003C\u002Fscript>\n```\n\n### Route Caching\n\n```typescript\nexport default defineNuxtConfig({\n  routeRules: {\n    '\u002F': { prerender: true },\n    '\u002Fabout': { prerender: true },\n    '\u002Fblog\u002F**': { swr: 3600 },\n    '\u002Fproducts\u002F**': { isr: 3600 },\n    '\u002Fdashboard\u002F**': { ssr: false },\n    '\u002Fstatic\u002F**': {\n      headers: { 'Cache-Control': 'public, max-age=31536000' }\n    }\n  }\n})\n```\n\n### Image Optimization\n\n```vue\n\u003Ctemplate>\n  \u003CNuxtImg\n    src=\"\u002Fimages\u002Fhero.jpg\"\n    alt=\"Hero image\"\n    width=\"800\"\n    height=\"400\"\n    loading=\"lazy\"\n    placeholder\n    format=\"webp\"\n  \u002F>\n\n  \u003CNuxtPicture\n    src=\"\u002Fimages\u002Fproduct.jpg\"\n    alt=\"Product\"\n    sizes=\"sm:100vw md:50vw lg:400px\"\n    :modifiers=\"{ quality: 80 }\"\n  \u002F>\n\u003C\u002Ftemplate>\n```\n\n## Testing with Vitest\n\n### Setup\n\n```bash\nbun add -d @nuxt\u002Ftest-utils vitest @vue\u002Ftest-utils happy-dom\n```\n\n```typescript\n\u002F\u002F vitest.config.ts\nimport { defineVitestConfig } from '@nuxt\u002Ftest-utils\u002Fconfig'\n\nexport default defineVitestConfig({\n  test: {\n    environment: 'nuxt',\n    environmentOptions: {\n      nuxt: {\n        domEnvironment: 'happy-dom'\n      }\n    }\n  }\n})\n```\n\n### Component Testing\n\n```typescript\nimport { describe, it, expect } from 'vitest'\nimport { mountSuspended } from '@nuxt\u002Ftest-utils\u002Fruntime'\nimport UserCard from '~\u002Fcomponents\u002FUserCard.vue'\n\ndescribe('UserCard', () => {\n  it('renders user name', async () => {\n    const wrapper = await mountSuspended(UserCard, {\n      props: {\n        user: { id: 1, name: 'John Doe', email: 'john@example.com' }\n      }\n    })\n\n    expect(wrapper.text()).toContain('John Doe')\n  })\n})\n```\n\n### Mocking Composables\n\n```typescript\nimport { mockNuxtImport } from '@nuxt\u002Ftest-utils\u002Fruntime'\n\nmockNuxtImport('useFetch', () => {\n  return () => ({\n    data: ref({ users: [{ id: 1, name: 'John' }] }),\n    pending: ref(false),\n    error: ref(null)\n  })\n})\n```\n\n## Deployment\n\n### Cloudflare Pages (Recommended)\n\n```bash\nbun run build\nbunx wrangler pages deploy .output\u002Fpublic\n```\n\n```typescript\nexport default defineNuxtConfig({\n  nitro: { preset: 'cloudflare_pages' }\n})\n```\n\n### Cloudflare Workers\n\n```typescript\nexport default defineNuxtConfig({\n  nitro: { preset: 'cloudflare_module' }\n})\n```\n\n### Vercel \u002F Netlify\n\n```typescript\n\u002F\u002F Vercel\nexport default defineNuxtConfig({\n  nitro: { preset: 'vercel' }\n})\n\n\u002F\u002F Netlify\nexport default defineNuxtConfig({\n  nitro: { preset: 'netlify' }\n})\n```\n\n### NuxtHub (Cloudflare All-in-One)\n\n```bash\nbun add @nuxthub\u002Fcore\n```\n\n```typescript\nexport default defineNuxtConfig({\n  modules: ['@nuxthub\u002Fcore'],\n  hub: {\n    database: true,\n    kv: true,\n    blob: true,\n    cache: true\n  }\n})\n```\n\n## Migration from Nuxt 4\n\n### Step 1: Update package.json\n\n```json\n{\n  \"devDependencies\": {\n    \"nuxt\": \"^5.0.0\"\n  }\n}\n```\n\n### Step 2: Enable Compatibility Mode\n\n```typescript\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  future: {\n    compatibilityVersion: 5\n  }\n})\n```\n\n### Step 3: Update Server Error Handling\n\n```typescript\n\u002F\u002F Before (Nuxt 4)\nimport { createError } from 'h3'\nthrow createError({ statusCode: 404, statusMessage: 'Not Found' })\n\n\u002F\u002F After (Nuxt 5)\nimport { HTTPError } from 'nitro\u002Fh3'\nthrow new HTTPError({ status: 404, statusText: 'Not Found' })\n```\n\n### Step 4: Update Server Event API\n\n```typescript\n\u002F\u002F Before (Nuxt 4)\nconst path = event.path\nevent.node.res.statusCode = 200\nsetResponseHeader(event, 'x-custom', 'value')\nconst config = useRuntimeConfig(event)\n\n\u002F\u002F After (Nuxt 5)\nconst path = event.url.pathname\nevent.res.status = 200\nevent.res.headers.set('x-custom', 'value')\nconst config = useRuntimeConfig()\n```\n\n### Step 5: Update Vite Config\n\n```typescript\n\u002F\u002F Before (Nuxt 4)\nexport default defineNuxtConfig({\n  vite: {\n    build: {\n      rollupOptions: { ... }\n    }\n  }\n})\n\n\u002F\u002F After (Nuxt 5) - use rolldownOptions\nexport default defineNuxtConfig({\n  vite: {\n    build: {\n      rolldownOptions: { ... }\n    }\n  }\n})\n```\n\n### Step 6: Update Route Rules\n\n```typescript\n\u002F\u002F Before\nrouteRules: {\n  '\u002Fold': { redirect: { to: '\u002Fnew', statusCode: 302 } }\n}\n\n\u002F\u002F After\nrouteRules: {\n  '\u002Fold': { redirect: { to: '\u002Fnew', status: 302 } }\n}\n```\n\n### Step 7: Update Import Paths\n\n```typescript\n\u002F\u002F Before\nimport { defineEventHandler, getQuery } from 'h3'\n\n\u002F\u002F After\nimport { defineEventHandler, getQuery } from 'nitro\u002Fh3'\n\u002F\u002F Or rely on auto-imports (no import needed)\n```\n\n### Step 8: Remove Deprecated Options\n\n```typescript\n\u002F\u002F Remove these from nuxt.config.ts\nexport default defineNuxtConfig({\n  experimental: {\n    externalVue: false,  \u002F\u002F REMOVED - delete this\n    viteEnvironmentApi: true,  \u002F\u002F REMOVED - always enabled\n  }\n})\n```\n\n### Step 9: Install JSX Plugin (If Needed)\n\n```bash\n# Only if your project uses .jsx\u002F.tsx files\nbun add -D @vitejs\u002Fplugin-vue-jsx\n```\n\n### Step 10: Update callHook Usage\n\n```typescript\n\u002F\u002F Before\nnuxtApp.callHook('my:hook', data).then(() => { ... })\n\n\u002F\u002F After\nawait nuxtApp.callHook('my:hook', data)\n```\n\n## Common Anti-Patterns\n\n### Client-Only Code on Server\n\n```typescript\n\u002F\u002F WRONG\nconst width = window.innerWidth\n\n\u002F\u002F CORRECT\nif (import.meta.client) {\n  const width = window.innerWidth\n}\n\n\u002F\u002F Or use onMounted\nonMounted(() => {\n  const width = window.innerWidth\n})\n```\n\n### Non-Deterministic SSR\n\n```typescript\n\u002F\u002F WRONG\nconst id = Math.random()\nconst time = Date.now()\n\n\u002F\u002F CORRECT\nconst id = useState('id', () => Math.random())\nconst time = useState('time', () => Date.now())\n```\n\n## Troubleshooting\n\n**Hydration Mismatch:**\n- Check for `window`, `document`, `localStorage` usage\n- Wrap in `ClientOnly` or use `onMounted`\n- Look for `Math.random()`, `Date.now()`\n- Check if relying on `\u003Cdiv>` placeholder for client-only components\n\n**Build Errors:**\n```bash\nrm -rf .nuxt .output node_modules\u002F.vite && bun install\n```\n\n**Vite Plugin Warnings:**\n- Migrate from `extendViteConfig({ server })` to `configEnvironment`\n- Use `applyToEnvironment` instead of `server: false` \u002F `client: false`\n\n**Rolldown Build Issues:**\n- Replace `rollupOptions` with `rolldownOptions`\n- Replace `vite.esbuild` with `vite.oxc`\n- Check CJS interop changes in Vite 8\n\n## Related Skills\n\n- **nuxt-core**: Project setup, routing, configuration\n- **nuxt-data**: Composables, data fetching, state\n- **nuxt-server**: Server routes, API patterns (Nitro v3)\n- **cloudflare-d1**: D1 database patterns\n\n---\n\n**Version**: 5.0.0 | **Last Updated**: 2026-03-30 | **License**: MIT\n","# Nuxt 5 Production Guide\n\nHydration, performance, testing, deployment, and migration patterns.\n\n## What's New in Nuxt 5\n\n### v5 Key Changes\n\n| Change | Nuxt 4 | Nuxt 5 |\n|--------|--------|--------|\n| Bundler | Vite 6 (esbuild + Rollup) | Vite 8 (Rolldown) |\n| Server engine | Nitro v2 | Nitro v3 (h3 v2) |\n| Server errors | `createError({statusCode})` | `HTTPError({status})` |\n| Client-only placeholder | Empty `\u003Cdiv>` | HTML comment node |\n| callHook | Always returns Promise | May return void |\n| clearNuxtState | Sets to `undefined` | Resets to initial default |\n| Page names | Auto-generated | Normalized to route names |\n| JSX support | Included by default | Optional (on-demand) |\n| externalVue | Configurable | Removed (always mocked) |\n\n### Client-Only Comment Placeholders (v5)\n\nClient-only components (`.client.vue` files and `createClientOnly()` wrappers) now render an HTML comment on the server instead of an empty `\u003Cdiv>`. This fixes scoped styles hydration issues.\n\n```vue\n\u003C!-- If you relied on the placeholder \u003Cdiv> for layout -->\n\u003CClientOnly>\n  \u003CMyComponent \u002F>\n  \u003Ctemplate #fallback>\n    \u003Cdiv class=\"placeholder\" style=\"min-height: 200px\">\u003C\u002Fdiv>\n  \u003C\u002Ftemplate>\n\u003C\u002FClientOnly>\n```\n\nTo revert to the old `\u003Cdiv>` behavior:\n\n```typescript\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  experimental: {\n    clientNodePlaceholder: false\n  }\n})\n```\n\n### Non-Async callHook (v5)\n\n`callHook` may now return `void` instead of always returning `Promise`. Always use `await`:\n\n```typescript\n\u002F\u002F WRONG\nnuxtApp.callHook('my:hook', data).then(() => { ... })\n\n\u002F\u002F CORRECT\nawait nuxtApp.callHook('my:hook', data)\n```\n\n## When to Load References\n\n**Load `references\u002Fhydration.md` when:**\n- Debugging \"Hydration node mismatch\" errors\n- Implementing ClientOnly components\n- Fixing non-deterministic rendering issues\n\n**Load `references\u002Fperformance.md` when:**\n- Optimizing Core Web Vitals scores\n- Implementing lazy loading and code splitting\n- Reducing bundle size\n\n**Load `references\u002Ftesting-vitest.md` when:**\n- Writing component tests with @nuxt\u002Ftest-utils\n- Testing composables with Nuxt context\n- Mocking Nuxt APIs\n\n**Load `references\u002Fdeployment-cloudflare.md` when:**\n- Deploying to Cloudflare Pages or Workers\n- Configuring wrangler.toml\n- Setting up NuxtHub integration\n\n## Hydration Best Practices\n\n### What Causes Hydration Mismatches\n\n| Cause | Example | Fix |\n|-------|---------|-----|\n| Non-deterministic values | `Math.random()` | Use `useState` |\n| Browser APIs on server | `window.innerWidth` | Use `onMounted` |\n| Date\u002Ftime on server | `new Date()` | Use `useState` or `ClientOnly` |\n| Third-party scripts | Analytics | Use `ClientOnly` |\n\n### Fix Patterns\n\n```vue\n\u003C!-- Non-deterministic values -->\n\u003Cscript setup>\nconst id = useState('random-id', () => Math.random())\n\u003C\u002Fscript>\n\n\u003C!-- Browser APIs -->\n\u003Cscript setup>\nconst width = ref(0)\nonMounted(() => {\n  width.value = window.innerWidth\n})\n\u003C\u002Fscript>\n\n\u003C!-- ClientOnly component -->\n\u003Ctemplate>\n  \u003CClientOnly>\n    \u003CMyMapComponent \u002F>\n    \u003Ctemplate #fallback>\n      \u003Cdiv class=\"skeleton\">Loading map...\u003C\u002Fdiv>\n    \u003C\u002Ftemplate>\n  \u003C\u002FClientOnly>\n\u003C\u002Ftemplate>\n```\n\n## Performance Optimization\n\n### Lazy Loading Components\n\n```vue\n\u003Cscript setup>\nconst HeavyChart = defineAsyncComponent(() =>\n  import('~\u002Fcomponents\u002FHeavyChart.vue')\n)\n\u003C\u002Fscript>\n```\n\n### Lazy Hydration\n\n```vue\n\u003Cscript setup>\nconst LazyComponent = defineLazyHydrationComponent(\n  'visible',\n  () => import('.\u002FHeavyComponent.vue')\n)\n\nconst InteractiveComponent = defineLazyHydrationComponent(\n  'interaction',\n  () => import('.\u002FInteractiveComponent.vue')\n)\n\nconst IdleComponent = defineLazyHydrationComponent(\n  'idle',\n  () => import('.\u002FIdleComponent.vue')\n)\n\u003C\u002Fscript>\n```\n\n### Route Caching\n\n```typescript\nexport default defineNuxtConfig({\n  routeRules: {\n    '\u002F': { prerender: true },\n    '\u002Fabout': { prerender: true },\n    '\u002Fblog\u002F**': { swr: 3600 },\n    '\u002Fproducts\u002F**': { isr: 3600 },\n    '\u002Fdashboard\u002F**': { ssr: false },\n    '\u002Fstatic\u002F**': {\n      headers: { 'Cache-Control': 'public, max-age=31536000' }\n    }\n  }\n})\n```\n\n### Image Optimization\n\n```vue\n\u003Ctemplate>\n  \u003CNuxtImg\n    src=\"\u002Fimages\u002Fhero.jpg\"\n    alt=\"Hero image\"\n    width=\"800\"\n    height=\"400\"\n    loading=\"lazy\"\n    placeholder\n    format=\"webp\"\n  \u002F>\n\n  \u003CNuxtPicture\n    src=\"\u002Fimages\u002Fproduct.jpg\"\n    alt=\"Product\"\n    sizes=\"sm:100vw md:50vw lg:400px\"\n    :modifiers=\"{ quality: 80 }\"\n  \u002F>\n\u003C\u002Ftemplate>\n```\n\n## Testing with Vitest\n\n### Setup\n\n```bash\nbun add -d @nuxt\u002Ftest-utils vitest @vue\u002Ftest-utils happy-dom\n```\n\n```typescript\n\u002F\u002F vitest.config.ts\nimport { defineVitestConfig } from '@nuxt\u002Ftest-utils\u002Fconfig'\n\nexport default defineVitestConfig({\n  test: {\n    environment: 'nuxt',\n    environmentOptions: {\n      nuxt: {\n        domEnvironment: 'happy-dom'\n      }\n    }\n  }\n})\n```\n\n### Component Testing\n\n```typescript\nimport { describe, it, expect } from 'vitest'\nimport { mountSuspended } from '@nuxt\u002Ftest-utils\u002Fruntime'\nimport UserCard from '~\u002Fcomponents\u002FUserCard.vue'\n\ndescribe('UserCard', () => {\n  it('renders user name', async () => {\n    const wrapper = await mountSuspended(UserCard, {\n      props: {\n        user: { id: 1, name: 'John Doe', email: 'john@example.com' }\n      }\n    })\n\n    expect(wrapper.text()).toContain('John Doe')\n  })\n})\n```\n\n### Mocking Composables\n\n```typescript\nimport { mockNuxtImport } from '@nuxt\u002Ftest-utils\u002Fruntime'\n\nmockNuxtImport('useFetch', () => {\n  return () => ({\n    data: ref({ users: [{ id: 1, name: 'John' }] }),\n    pending: ref(false),\n    error: ref(null)\n  })\n})\n```\n\n## Deployment\n\n### Cloudflare Pages (Recommended)\n\n```bash\nbun run build\nbunx wrangler pages deploy .output\u002Fpublic\n```\n\n```typescript\nexport default defineNuxtConfig({\n  nitro: { preset: 'cloudflare_pages' }\n})\n```\n\n### Cloudflare Workers\n\n```typescript\nexport default defineNuxtConfig({\n  nitro: { preset: 'cloudflare_module' }\n})\n```\n\n### Vercel \u002F Netlify\n\n```typescript\n\u002F\u002F Vercel\nexport default defineNuxtConfig({\n  nitro: { preset: 'vercel' }\n})\n\n\u002F\u002F Netlify\nexport default defineNuxtConfig({\n  nitro: { preset: 'netlify' }\n})\n```\n\n### NuxtHub (Cloudflare All-in-One)\n\n```bash\nbun add @nuxthub\u002Fcore\n```\n\n```typescript\nexport default defineNuxtConfig({\n  modules: ['@nuxthub\u002Fcore'],\n  hub: {\n    database: true,\n    kv: true,\n    blob: true,\n    cache: true\n  }\n})\n```\n\n## Migration from Nuxt 4\n\n### Step 1: Update package.json\n\n```json\n{\n  \"devDependencies\": {\n    \"nuxt\": \"^5.0.0\"\n  }\n}\n```\n\n### Step 2: Enable Compatibility Mode\n\n```typescript\n\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  future: {\n    compatibilityVersion: 5\n  }\n})\n```\n\n### Step 3: Update Server Error Handling\n\n```typescript\n\u002F\u002F Before (Nuxt 4)\nimport { createError } from 'h3'\nthrow createError({ statusCode: 404, statusMessage: 'Not Found' })\n\n\u002F\u002F After (Nuxt 5)\nimport { HTTPError } from 'nitro\u002Fh3'\nthrow new HTTPError({ status: 404, statusText: 'Not Found' })\n```\n\n### Step 4: Update Server Event API\n\n```typescript\n\u002F\u002F Before (Nuxt 4)\nconst path = event.path\nevent.node.res.statusCode = 200\nsetResponseHeader(event, 'x-custom', 'value')\nconst config = useRuntimeConfig(event)\n\n\u002F\u002F After (Nuxt 5)\nconst path = event.url.pathname\nevent.res.status = 200\nevent.res.headers.set('x-custom', 'value')\nconst config = useRuntimeConfig()\n```\n\n### Step 5: Update Vite Config\n\n```typescript\n\u002F\u002F Before (Nuxt 4)\nexport default defineNuxtConfig({\n  vite: {\n    build: {\n      rollupOptions: { ... }\n    }\n  }\n})\n\n\u002F\u002F After (Nuxt 5) - use rolldownOptions\nexport default defineNuxtConfig({\n  vite: {\n    build: {\n      rolldownOptions: { ... }\n    }\n  }\n})\n```\n\n### Step 6: Update Route Rules\n\n```typescript\n\u002F\u002F Before\nrouteRules: {\n  '\u002Fold': { redirect: { to: '\u002Fnew', statusCode: 302 } }\n}\n\n\u002F\u002F After\nrouteRules: {\n  '\u002Fold': { redirect: { to: '\u002Fnew', status: 302 } }\n}\n```\n\n### Step 7: Update Import Paths\n\n```typescript\n\u002F\u002F Before\nimport { defineEventHandler, getQuery } from 'h3'\n\n\u002F\u002F After\nimport { defineEventHandler, getQuery } from 'nitro\u002Fh3'\n\u002F\u002F Or rely on auto-imports (no import needed)\n```\n\n### Step 8: Remove Deprecated Options\n\n```typescript\n\u002F\u002F Remove these from nuxt.config.ts\nexport default defineNuxtConfig({\n  experimental: {\n    externalVue: false,  \u002F\u002F REMOVED - delete this\n    viteEnvironmentApi: true,  \u002F\u002F REMOVED - always enabled\n  }\n})\n```\n\n### Step 9: Install JSX Plugin (If Needed)\n\n```bash\n# Only if your project uses .jsx\u002F.tsx files\nbun add -D @vitejs\u002Fplugin-vue-jsx\n```\n\n### Step 10: Update callHook Usage\n\n```typescript\n\u002F\u002F Before\nnuxtApp.callHook('my:hook', data).then(() => { ... })\n\n\u002F\u002F After\nawait nuxtApp.callHook('my:hook', data)\n```\n\n## Common Anti-Patterns\n\n### Client-Only Code on Server\n\n```typescript\n\u002F\u002F WRONG\nconst width = window.innerWidth\n\n\u002F\u002F CORRECT\nif (import.meta.client) {\n  const width = window.innerWidth\n}\n\n\u002F\u002F Or use onMounted\nonMounted(() => {\n  const width = window.innerWidth\n})\n```\n\n### Non-Deterministic SSR\n\n```typescript\n\u002F\u002F WRONG\nconst id = Math.random()\nconst time = Date.now()\n\n\u002F\u002F CORRECT\nconst id = useState('id', () => Math.random())\nconst time = useState('time', () => Date.now())\n```\n\n## Troubleshooting\n\n**Hydration Mismatch:**\n- Check for `window`, `document`, `localStorage` usage\n- Wrap in `ClientOnly` or use `onMounted`\n- Look for `Math.random()`, `Date.now()`\n- Check if relying on `\u003Cdiv>` placeholder for client-only components\n\n**Build Errors:**\n```bash\nrm -rf .nuxt .output node_modules\u002F.vite && bun install\n```\n\n**Vite Plugin Warnings:**\n- Migrate from `extendViteConfig({ server })` to `configEnvironment`\n- Use `applyToEnvironment` instead of `server: false` \u002F `client: false`\n\n**Rolldown Build Issues:**\n- Replace `rollupOptions` with `rolldownOptions`\n- Replace `vite.esbuild` with `vite.oxc`\n- Check CJS interop changes in Vite 8\n\n## Related Skills\n\n- **nuxt-core**: Project setup, routing, configuration\n- **nuxt-data**: Composables, data fetching, state\n- **nuxt-server**: Server routes, API patterns (Nitro v3)\n- **cloudflare-d1**: D1 database patterns\n\n---\n\n**Version**: 5.0.0 | **Last Updated**: 2026-03-30 | **License**: MIT\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26,"category":27,"keywords":28,"framework":50,"last-verified":51,"framework-version":52},"Claude Skills Maintainers","5.0.0","Framework",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"hydration","hydration mismatch","ClientOnly","SSR","performance","lazy loading","lazy hydration","Vitest","testing","deployment","Cloudflare Pages","Cloudflare Workers","Vercel","Netlify","NuxtHub","migration","Nuxt 4 to Nuxt 5","Rolldown","Vite 8","Nitro v3","comment placeholder","Nuxt",1774828800000,"5.x","main","c475fc64e94e803b50d14a791dfee8853fbb2c5c","integrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory","https:\u002F\u002Fgithub.com\u002FElogic360","2026-11-08 22:21:22",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add Elogic360\u002Fsoftware-factory --skill nuxt-production",{"tool":65,"command":66},"bunx","bunx skills add Elogic360\u002Fsoftware-factory --skill nuxt-production",{"tool":68,"command":69},"pnpm","pnpm dlx skills add Elogic360\u002Fsoftware-factory --skill nuxt-production","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002FSKILL.md",true,[73,79,83,87,91,97],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fdeployment-cloudflare.md","REFERENCE","参考文档",13874,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002Freferences\u002Fdeployment-cloudflare.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fhydration.md",8599,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002Freferences\u002Fhydration.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fperformance.md",12095,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002Freferences\u002Fperformance.md",{"path":88,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Ftesting-vitest.md",13487,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002Freferences\u002Ftesting-vitest.md",{"path":92,"resourceType":93,"resourceTypeDesc":94,"sizeBytes":95,"sourceHtmlUrl":96},"templates\u002Ftests\u002Fcomponents\u002FBlogPost.test.ts","SCRIPT","脚本",1200,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002Ftemplates\u002Ftests\u002Fcomponents\u002FBlogPost.test.ts",{"path":98,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":101,"sourceHtmlUrl":102},"templates\u002Fwrangler.toml","OTHER","其他",1033,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fnuxt-v5\u002Fskills\u002Fnuxt-production\u002Ftemplates\u002Fwrangler.toml",[104,112,119,126,133,140],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M79G206MT3J6S0GY3C45P2KV","vss-summarize-video","Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-summarize-video\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M79G1WN63PGRE8CKD47WEBQ5","vss-setup-video-analytics-api","Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-video-analytics-api\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":19},"01M79G1S9F7VY3EF6H53PRP5AN","vss-setup-behavior-analytics","Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-behavior-analytics\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":19},"01M79G1N1S1Y27PFZPYMNK1MTQ","vss-search-archive","Use this skill to run top-level VSS fusion search on archived video, or to ingest video files \u002F RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-search-archive\u002FSKILL.md",[],[],{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":19},"01M79G1H6WN0Q6C0VCAXCZX6B7","vss-query-analytics","Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-query-analytics\u002FSKILL.md",[],[],{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":19},"01M79G1DYPNXQS7QHZ0AAF5FX5","vss-manage-video-io-storage","Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add\u002Fdelete sensors and streams). Not for VLM inference or search.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-manage-video-io-storage\u002FSKILL.md",[],[]]