@nuxt/docs 3.20.2 → 3.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/1.getting-started/01.introduction.md +4 -4
  2. package/1.getting-started/02.installation.md +4 -7
  3. package/1.getting-started/03.configuration.md +29 -29
  4. package/1.getting-started/04.views.md +6 -4
  5. package/1.getting-started/05.assets.md +2 -2
  6. package/1.getting-started/06.styling.md +22 -16
  7. package/1.getting-started/07.routing.md +6 -6
  8. package/1.getting-started/08.seo-meta.md +8 -4
  9. package/1.getting-started/09.transitions.md +6 -6
  10. package/1.getting-started/10.data-fetching.md +18 -18
  11. package/1.getting-started/11.state-management.md +5 -5
  12. package/1.getting-started/12.error-handling.md +25 -19
  13. package/1.getting-started/13.server.md +9 -9
  14. package/1.getting-started/14.layers.md +49 -15
  15. package/1.getting-started/15.prerendering.md +18 -4
  16. package/1.getting-started/16.deployment.md +2 -1
  17. package/1.getting-started/17.testing.md +17 -7
  18. package/1.getting-started/18.upgrade.md +111 -60
  19. package/2.directory-structure/0.output.md +1 -1
  20. package/2.directory-structure/1.assets.md +1 -1
  21. package/2.directory-structure/1.components.md +12 -8
  22. package/2.directory-structure/1.composables.md +2 -2
  23. package/2.directory-structure/1.content.md +1 -1
  24. package/2.directory-structure/1.layers.md +87 -0
  25. package/2.directory-structure/1.layouts.md +35 -3
  26. package/2.directory-structure/1.middleware.md +7 -7
  27. package/2.directory-structure/1.modules.md +8 -2
  28. package/2.directory-structure/1.node_modules.md +1 -1
  29. package/2.directory-structure/1.pages.md +39 -18
  30. package/2.directory-structure/1.plugins.md +4 -1
  31. package/2.directory-structure/1.public.md +1 -1
  32. package/2.directory-structure/1.server.md +28 -8
  33. package/2.directory-structure/1.shared.md +3 -3
  34. package/2.directory-structure/1.utils.md +2 -2
  35. package/2.directory-structure/2.env.md +3 -3
  36. package/2.directory-structure/2.nuxtignore.md +1 -0
  37. package/2.directory-structure/2.nuxtrc.md +5 -2
  38. package/2.directory-structure/3.app-config.md +2 -2
  39. package/2.directory-structure/3.app.md +3 -3
  40. package/2.directory-structure/3.error.md +9 -5
  41. package/2.directory-structure/3.nuxt-config.md +1 -1
  42. package/2.directory-structure/3.package.md +1 -1
  43. package/2.directory-structure/3.tsconfig.md +3 -2
  44. package/2.directory-structure/index.md +12 -8
  45. package/3.guide/0.index.md +5 -2
  46. package/3.guide/1.concepts/{3.rendering.md → 1.rendering.md} +11 -32
  47. package/3.guide/1.concepts/{2.vuejs-development.md → 10.vuejs-development.md} +9 -8
  48. package/3.guide/1.concepts/{10.nuxt-lifecycle.md → 2.nuxt-lifecycle.md} +31 -24
  49. package/3.guide/1.concepts/{1.auto-imports.md → 3.auto-imports.md} +6 -6
  50. package/3.guide/1.concepts/4.server-engine.md +2 -2
  51. package/3.guide/1.concepts/5.modules.md +14 -1
  52. package/3.guide/1.concepts/7.esm.md +5 -4
  53. package/3.guide/1.concepts/8.typescript.md +9 -15
  54. package/3.guide/1.concepts/9.code-style.md +1 -1
  55. package/3.guide/2.best-practices/hydration.md +1 -1
  56. package/3.guide/2.best-practices/performance.md +5 -5
  57. package/3.guide/3.ai/.navigation.yml +3 -0
  58. package/3.guide/3.ai/1.mcp.md +277 -0
  59. package/3.guide/3.ai/2.llms-txt.md +65 -0
  60. package/3.guide/4.modules/.navigation.yml +3 -0
  61. package/3.guide/4.modules/1.getting-started.md +103 -0
  62. package/3.guide/4.modules/2.module-anatomy.md +138 -0
  63. package/3.guide/4.modules/3.recipes-basics.md +420 -0
  64. package/3.guide/4.modules/4.recipes-advanced.md +243 -0
  65. package/3.guide/4.modules/5.testing.md +76 -0
  66. package/3.guide/4.modules/6.best-practices.md +104 -0
  67. package/3.guide/4.modules/7.ecosystem.md +32 -0
  68. package/3.guide/4.modules/index.md +36 -0
  69. package/3.guide/{3.recipes → 5.recipes}/1.custom-routing.md +3 -3
  70. package/3.guide/{3.recipes → 5.recipes}/2.vite-plugin.md +4 -0
  71. package/3.guide/{3.recipes → 5.recipes}/3.custom-usefetch.md +2 -2
  72. package/3.guide/{3.recipes → 5.recipes}/4.sessions-and-authentication.md +3 -3
  73. package/3.guide/{4.going-further → 6.going-further}/1.events.md +3 -4
  74. package/3.guide/{4.going-further → 6.going-further}/1.experimental-features.md +211 -86
  75. package/3.guide/6.going-further/1.features.md +108 -0
  76. package/3.guide/{4.going-further → 6.going-further}/1.internals.md +4 -3
  77. package/3.guide/{4.going-further → 6.going-further}/10.runtime-config.md +2 -2
  78. package/3.guide/{4.going-further → 6.going-further}/11.nightly-release-channel.md +1 -1
  79. package/3.guide/{4.going-further → 6.going-further}/2.hooks.md +5 -5
  80. package/3.guide/{4.going-further → 6.going-further}/4.kit.md +3 -3
  81. package/3.guide/{4.going-further → 6.going-further}/6.nuxt-app.md +6 -6
  82. package/3.guide/{4.going-further → 6.going-further}/7.layers.md +31 -5
  83. package/3.guide/{4.going-further → 6.going-further}/9.debugging.md +3 -2
  84. package/4.api/1.components/1.nuxt-client-fallback.md +5 -1
  85. package/4.api/1.components/10.nuxt-picture.md +1 -1
  86. package/4.api/1.components/11.teleports.md +2 -2
  87. package/4.api/1.components/12.nuxt-route-announcer.md +0 -2
  88. package/4.api/1.components/13.nuxt-time.md +0 -2
  89. package/4.api/1.components/2.nuxt-page.md +3 -3
  90. package/4.api/1.components/3.nuxt-layout.md +6 -6
  91. package/4.api/1.components/4.nuxt-link.md +13 -13
  92. package/4.api/1.components/5.nuxt-loading-indicator.md +1 -1
  93. package/4.api/1.components/6.nuxt-error-boundary.md +2 -2
  94. package/4.api/1.components/7.nuxt-welcome.md +2 -2
  95. package/4.api/1.components/8.nuxt-island.md +9 -2
  96. package/4.api/2.composables/use-app-config.md +1 -1
  97. package/4.api/2.composables/use-async-data.md +5 -5
  98. package/4.api/2.composables/use-cookie.md +16 -16
  99. package/4.api/2.composables/use-error.md +3 -3
  100. package/4.api/2.composables/use-fetch.md +37 -37
  101. package/4.api/2.composables/use-head-safe.md +1 -1
  102. package/4.api/2.composables/use-head.md +22 -7
  103. package/4.api/2.composables/use-lazy-async-data.md +1 -1
  104. package/4.api/2.composables/use-lazy-fetch.md +9 -9
  105. package/4.api/2.composables/use-nuxt-app.md +9 -7
  106. package/4.api/2.composables/use-route-announcer.md +1 -3
  107. package/4.api/2.composables/use-route.md +2 -2
  108. package/4.api/2.composables/use-router.md +15 -15
  109. package/4.api/2.composables/use-runtime-config.md +5 -5
  110. package/4.api/2.composables/use-seo-meta.md +2 -2
  111. package/4.api/2.composables/use-server-seo-meta.md +2 -2
  112. package/4.api/2.composables/use-state.md +12 -2
  113. package/4.api/3.utils/$fetch.md +1 -1
  114. package/4.api/3.utils/abort-navigation.md +2 -2
  115. package/4.api/3.utils/call-once.md +2 -4
  116. package/4.api/3.utils/clear-error.md +1 -1
  117. package/4.api/3.utils/create-error.md +7 -7
  118. package/4.api/3.utils/define-lazy-hydration-component.md +5 -5
  119. package/4.api/3.utils/define-nuxt-component.md +1 -1
  120. package/4.api/3.utils/define-nuxt-plugin.md +12 -12
  121. package/4.api/3.utils/define-nuxt-route-middleware.md +2 -2
  122. package/4.api/3.utils/define-page-meta.md +18 -11
  123. package/4.api/3.utils/define-route-rules.md +2 -2
  124. package/4.api/3.utils/navigate-to.md +14 -14
  125. package/4.api/3.utils/on-before-route-leave.md +1 -1
  126. package/4.api/3.utils/on-before-route-update.md +1 -1
  127. package/4.api/3.utils/preload-route-components.md +2 -2
  128. package/4.api/3.utils/refresh-cookie.md +0 -2
  129. package/4.api/3.utils/refresh-nuxt-data.md +1 -1
  130. package/4.api/3.utils/reload-nuxt-app.md +1 -1
  131. package/4.api/3.utils/set-page-layout.md +36 -0
  132. package/4.api/3.utils/set-response-status.md +3 -3
  133. package/4.api/3.utils/show-error.md +4 -4
  134. package/4.api/3.utils/update-app-config.md +1 -1
  135. package/4.api/4.commands/add.md +12 -12
  136. package/4.api/4.commands/analyze.md +11 -11
  137. package/4.api/4.commands/build-module.md +11 -11
  138. package/4.api/4.commands/build.md +12 -12
  139. package/4.api/4.commands/cleanup.md +6 -6
  140. package/4.api/4.commands/dev.md +23 -23
  141. package/4.api/4.commands/devtools.md +7 -7
  142. package/4.api/4.commands/generate.md +12 -12
  143. package/4.api/4.commands/info.md +6 -6
  144. package/4.api/4.commands/init.md +18 -18
  145. package/4.api/4.commands/module.md +18 -18
  146. package/4.api/4.commands/prepare.md +10 -10
  147. package/4.api/4.commands/preview.md +11 -11
  148. package/4.api/4.commands/test.md +9 -9
  149. package/4.api/4.commands/typecheck.md +10 -10
  150. package/4.api/4.commands/upgrade.md +10 -10
  151. package/4.api/5.kit/1.modules.md +31 -18
  152. package/4.api/5.kit/10.templates.md +23 -23
  153. package/4.api/5.kit/11.nitro.md +40 -36
  154. package/4.api/5.kit/12.resolving.md +2 -2
  155. package/4.api/5.kit/14.builder.md +35 -23
  156. package/4.api/5.kit/16.layers.md +16 -16
  157. package/4.api/5.kit/2.programmatic.md +2 -2
  158. package/4.api/5.kit/3.compatibility.md +2 -2
  159. package/4.api/5.kit/4.autoimports.md +23 -19
  160. package/4.api/5.kit/5.components.md +35 -35
  161. package/4.api/5.kit/6.context.md +1 -1
  162. package/4.api/5.kit/8.layout.md +1 -1
  163. package/4.api/6.advanced/1.hooks.md +85 -85
  164. package/4.api/index.md +7 -7
  165. package/5.community/4.contribution.md +10 -10
  166. package/5.community/5.framework-contribution.md +9 -9
  167. package/5.community/6.roadmap.md +26 -26
  168. package/5.community/7.changelog.md +10 -0
  169. package/6.bridge/1.overview.md +8 -0
  170. package/6.bridge/3.bridge-composition-api.md +2 -2
  171. package/6.bridge/4.plugins-and-middleware.md +2 -2
  172. package/6.bridge/5.nuxt3-compatible-api.md +1 -1
  173. package/6.bridge/8.nitro.md +4 -0
  174. package/7.migration/10.bundling.md +1 -1
  175. package/7.migration/11.server.md +3 -3
  176. package/7.migration/2.configuration.md +5 -5
  177. package/7.migration/20.module-authors.md +3 -3
  178. package/7.migration/4.meta.md +1 -1
  179. package/7.migration/5.plugins-and-middleware.md +3 -3
  180. package/7.migration/6.pages-and-layouts.md +5 -5
  181. package/7.migration/7.component-options.md +6 -6
  182. package/7.migration/8.runtime-config.md +1 -1
  183. package/package.json +1 -1
  184. package/3.guide/4.going-further/1.features.md +0 -103
  185. package/3.guide/4.going-further/3.modules.md +0 -901
  186. /package/3.guide/{3.recipes → 5.recipes}/.navigation.yml +0 -0
  187. /package/3.guide/{4.going-further → 6.going-further}/.navigation.yml +0 -0
  188. /package/3.guide/{4.going-further → 6.going-further}/index.md +0 -0
@@ -80,11 +80,11 @@ async function addTodo () {
80
80
  ```
81
81
 
82
82
  ::warning
83
- Beware that using only `$fetch` will not provide [network calls de-duplication and navigation prevention](#the-need-for-usefetch-and-useasyncdata). :br
84
- It is recommended to use `$fetch` for client-side interactions (event-based) or combined with [`useAsyncData`](#useasyncdata) when fetching the initial component data.
83
+ Beware that using only `$fetch` will not provide [network calls de-duplication and navigation prevention](/docs/3.x/getting-started/data-fetching#the-need-for-usefetch-and-useasyncdata). :br
84
+ It is recommended to use `$fetch` for client-side interactions (event-based) or combined with [`useAsyncData`](/docs/3.x/getting-started/data-fetching#useasyncdata) when fetching the initial component data.
85
85
  ::
86
86
 
87
- ::read-more{to="/docs/api/utils/dollarfetch"}
87
+ ::read-more{to="/docs/3.x/api/utils/dollarfetch"}
88
88
  Read more about `$fetch`.
89
89
  ::
90
90
 
@@ -146,9 +146,9 @@ This composable is a wrapper around the [`useAsyncData`](/docs/3.x/api/composabl
146
146
 
147
147
  :video-accordion{title="Watch a video from Alexander Lichter to avoid using useFetch the wrong way" videoId="njsGVmcWviY"}
148
148
 
149
- :read-more{to="/docs/api/composables/use-fetch"}
149
+ :read-more{to="/docs/3.x/api/composables/use-fetch"}
150
150
 
151
- :link-example{to="/docs/examples/features/data-fetching"}
151
+ :link-example{to="/docs/3.x/examples/features/data-fetching"}
152
152
 
153
153
  ## `useAsyncData`
154
154
 
@@ -220,7 +220,7 @@ await useAsyncData(() => offersStore.getOffer(route.params.slug))
220
220
  ```
221
221
  ::
222
222
 
223
- ::read-more{to="/docs/api/composables/use-async-data"}
223
+ ::read-more{to="/docs/3.x/api/composables/use-async-data"}
224
224
  Read more about `useAsyncData`.
225
225
  ::
226
226
 
@@ -280,11 +280,11 @@ const { status, data: posts } = useLazyFetch('/api/posts')
280
280
  </script>
281
281
  ```
282
282
 
283
- ::read-more{to="/docs/api/composables/use-lazy-fetch"}
283
+ ::read-more{to="/docs/3.x/api/composables/use-lazy-fetch"}
284
284
  Read more about `useLazyFetch`.
285
285
  ::
286
286
 
287
- ::read-more{to="/docs/api/composables/use-lazy-async-data"}
287
+ ::read-more{to="/docs/3.x/api/composables/use-lazy-async-data"}
288
288
  Read more about `useLazyAsyncData`.
289
289
  ::
290
290
 
@@ -307,7 +307,7 @@ const { status, data: comments } = useFetch('/api/comments', {
307
307
  })
308
308
  ```
309
309
 
310
- The `useFetch` composable is meant to be invoked in setup method or called directly at the top level of a function in lifecycle hooks, otherwise you should use [`$fetch` method](#fetch).
310
+ The `useFetch` composable is meant to be invoked in setup method or called directly at the top level of a function in lifecycle hooks, otherwise you should use [`$fetch` method](/docs/3.x/getting-started/data-fetching#fetch).
311
311
 
312
312
  ### Minimize payload size
313
313
 
@@ -433,7 +433,7 @@ const { data, error, execute, refresh } = await useFetch('/api/users')
433
433
  </template>
434
434
  ```
435
435
 
436
- The `execute` function is an alias for `refresh` that works in exactly the same way but is more semantic for cases when the fetch is [not immediate](#not-immediate).
436
+ The `execute` function is an alias for `refresh` that works in exactly the same way but is more semantic for cases when the fetch is [not immediate](/docs/3.x/getting-started/data-fetching#not-immediate).
437
437
 
438
438
  ::tip
439
439
  To globally refetch or invalidate cached data, see [`clearNuxtData`](/docs/3.x/api/utils/clear-nuxt-data) and [`refreshNuxtData`](/docs/3.x/api/utils/refresh-nuxt-data).
@@ -483,7 +483,7 @@ const { data, error, refresh } = await useFetch(`/api/users/${id.value}`, {
483
483
  </script>
484
484
  ```
485
485
 
486
- If you need to change the URL based on a reactive value, you may want to use a [computed URL](#computed-url) instead.
486
+ If you need to change the URL based on a reactive value, you may want to use a [computed URL](/docs/3.x/getting-started/data-fetching#computed-url) instead.
487
487
 
488
488
  When reactive fetch options are provided, they'll be automatically watched and trigger refetches. In some cases, it can be useful to opt-out of this behavior by specifying `watch: false`.
489
489
 
@@ -516,9 +516,9 @@ const { data, status } = useLazyFetch('/api/user', {
516
516
  </script>
517
517
  ```
518
518
 
519
- In the case of more complex URL construction, you may use a callback as a [computed getter](https://vuejs.org/guide/essentials/computed.html) that returns the URL string.
519
+ In the case of more complex URL construction, you may use a callback as a [computed getter](https://vuejs.org/guide/essentials/computed) that returns the URL string.
520
520
 
521
- Every time a dependency changes, the data will be fetched using the newly constructed URL. Combine this with [not-immediate](#not-immediate), and you can wait until the reactive element changes before fetching.
521
+ Every time a dependency changes, the data will be fetched using the newly constructed URL. Combine this with [not-immediate](/docs/3.x/getting-started/data-fetching#not-immediate), and you can wait until the reactive element changes before fetching.
522
522
 
523
523
  ```vue
524
524
  <script setup lang="ts">
@@ -555,7 +555,7 @@ const pending = computed(() => status.value === 'pending')
555
555
  </template>
556
556
  ```
557
557
 
558
- If you need to force a refresh when other reactive values change, you can also [watch other values](#watch).
558
+ If you need to force a refresh when other reactive values change, you can also [watch other values](/docs/3.x/getting-started/data-fetching#watch).
559
559
 
560
560
  ### Not immediate
561
561
 
@@ -657,11 +657,11 @@ export default defineNuxtComponent({
657
657
  Using `<script setup>` or `<script setup lang="ts">` are the recommended way of declaring Vue components in Nuxt.
658
658
  ::
659
659
 
660
- :read-more{to="/docs/api/utils/define-nuxt-component"}
660
+ :read-more{to="/docs/3.x/api/utils/define-nuxt-component"}
661
661
 
662
662
  ## Serializing Data From Server to Client
663
663
 
664
- When using `useAsyncData` and `useLazyAsyncData` to transfer data fetched on server to the client (as well as anything else that utilizes [the Nuxt payload](/docs/3.x/api/composables/use-nuxt-app#payload)), the payload is serialized with [`devalue`](https://github.com/Rich-Harris/devalue). This allows us to transfer not just basic JSON but also to serialize and revive/deserialize more advanced kinds of data, such as regular expressions, Dates, Map and Set, `ref`, `reactive`, `shallowRef`, `shallowReactive` and `NuxtError` - and more.
664
+ When using `useAsyncData` and `useLazyAsyncData` to transfer data fetched on server to the client (as well as anything else that utilizes [the Nuxt payload](/docs/3.x/api/composables/use-nuxt-app#payload)), the payload is serialized with [`devalue`](https://github.com/sveltejs/devalue). This allows us to transfer not just basic JSON but also to serialize and revive/deserialize more advanced kinds of data, such as regular expressions, Dates, Map and Set, `ref`, `reactive`, `shallowRef`, `shallowReactive` and `NuxtError` - and more.
665
665
 
666
666
  It is also possible to define your own serializer/deserializer for types that are not supported by Nuxt. You can read more in the [`useNuxtApp`](/docs/3.x/api/composables/use-nuxt-app#payload) docs.
667
667
 
@@ -733,7 +733,7 @@ const { data } = await useFetch('/api/bar')
733
733
 
734
734
  Nuxt does not currently support an alternative serializer to `JSON.stringify`. However, you can return your payload as a normal string and utilize the `toJSON` method to maintain type safety.
735
735
 
736
- In the example below, we use [superjson](https://github.com/blitz-js/superjson) as our serializer.
736
+ In the example below, we use [superjson](https://github.com/flightcontrolhq/superjson) as our serializer.
737
737
 
738
738
  ```ts [server/api/superjson.ts]
739
739
  import superjson from 'superjson'
@@ -771,7 +771,7 @@ const { data } = await useFetch('/api/superjson', {
771
771
  ### Consuming SSE (Server-Sent Events) via POST request
772
772
 
773
773
  ::tip
774
- If you're consuming SSE via GET request, you can use [`EventSource`](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) or VueUse composable [`useEventSource`](https://vueuse.org/core/useEventSource/).
774
+ If you're consuming SSE via GET request, you can use [`EventSource`](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) or VueUse composable [`useEventSource`](https://vueuse.org/core/useeventsource/).
775
775
  ::
776
776
 
777
777
  When consuming SSE via POST request, you need to handle the connection manually. Here's how you can do it:
@@ -6,7 +6,7 @@ navigation.icon: i-lucide-database
6
6
 
7
7
  Nuxt provides the [`useState`](/docs/3.x/api/composables/use-state) composable to create a reactive and SSR-friendly shared state across components.
8
8
 
9
- [`useState`](/docs/3.x/api/composables/use-state) is an SSR-friendly [`ref`](https://vuejs.org/api/reactivity-core.html#ref) replacement. Its value will be preserved after server-side rendering (during client-side hydration) and shared across all components using a unique key.
9
+ [`useState`](/docs/3.x/api/composables/use-state) is an SSR-friendly [`ref`](https://vuejs.org/api/reactivity-core#ref) replacement. Its value will be preserved after server-side rendering (during client-side hydration) and shared across all components using a unique key.
10
10
 
11
11
  :video-accordion{title="Watch a video from Alexander Lichter about why and when to use useState" videoId="mv0WcBABcIk"}
12
12
 
@@ -14,7 +14,7 @@ Nuxt provides the [`useState`](/docs/3.x/api/composables/use-state) composable t
14
14
  Because the data inside [`useState`](/docs/3.x/api/composables/use-state) will be serialized to JSON, it is important that it does not contain anything that cannot be serialized, such as classes, functions or symbols.
15
15
  ::
16
16
 
17
- ::read-more{to="/docs/api/composables/use-state"}
17
+ ::read-more{to="/docs/3.x/api/composables/use-state"}
18
18
  Read more about `useState` composable.
19
19
  ::
20
20
 
@@ -53,7 +53,7 @@ const counter = useState('counter', () => Math.round(Math.random() * 1000))
53
53
  </template>
54
54
  ```
55
55
 
56
- :link-example{to="/docs/examples/features/state-management"}
56
+ :link-example{to="/docs/3.x/examples/features/state-management"}
57
57
 
58
58
  ::note
59
59
  To globally invalidate cached state, see [`clearNuxtState`](/docs/3.x/api/utils/clear-nuxt-state) util.
@@ -77,7 +77,7 @@ await callOnce(async () => {
77
77
  This is similar to the [`nuxtServerInit` action](https://v2.nuxt.com/docs/directory-structure/store/#the-nuxtserverinit-action) in Nuxt 2, which allows filling the initial state of your store server-side before rendering the page.
78
78
  ::
79
79
 
80
- :read-more{to="/docs/api/utils/call-once"}
80
+ :read-more{to="/docs/3.x/api/utils/call-once"}
81
81
 
82
82
  ### Usage with Pinia
83
83
 
@@ -194,7 +194,7 @@ const date = useLocaleDate(new Date('2016-10-26'))
194
194
  ```
195
195
  ::
196
196
 
197
- :link-example{to="/docs/examples/advanced/locale"}
197
+ :link-example{to="/docs/3.x/examples/advanced/locale"}
198
198
 
199
199
  ## Shared State
200
200
 
@@ -17,11 +17,11 @@ Nuxt is a full-stack framework, which means there are several sources of unpreve
17
17
 
18
18
  ## Vue Errors
19
19
 
20
- You can hook into Vue errors using [`onErrorCaptured`](https://vuejs.org/api/composition-api-lifecycle.html#onerrorcaptured).
20
+ You can hook into Vue errors using [`onErrorCaptured`](https://vuejs.org/api/composition-api-lifecycle#onerrorcaptured).
21
21
 
22
22
  In addition, Nuxt provides a [`vue:error`](/docs/3.x/api/advanced/hooks#app-hooks-runtime) hook that will be called if any errors propagate up to the top level.
23
23
 
24
- If you are using an error reporting framework, you can provide a global handler through [`vueApp.config.errorHandler`](https://vuejs.org/api/application.html#app-config-errorhandler). It will receive all Vue errors, even if they are handled.
24
+ If you are using an error reporting framework, you can provide a global handler through [`vueApp.config.errorHandler`](https://vuejs.org/api/application#app-config-errorhandler). It will receive all Vue errors, even if they are handled.
25
25
 
26
26
  ```ts twoslash [plugins/error-handler.ts]
27
27
  export default defineNuxtPlugin((nuxtApp) => {
@@ -37,7 +37,7 @@ export default defineNuxtPlugin((nuxtApp) => {
37
37
  ```
38
38
 
39
39
  ::note
40
- Note that the `vue:error` hook is based on [`onErrorCaptured`](https://vuejs.org/api/composition-api-lifecycle.html#onerrorcaptured) lifecycle hook.
40
+ Note that the `vue:error` hook is based on [`onErrorCaptured`](https://vuejs.org/api/composition-api-lifecycle#onerrorcaptured) lifecycle hook.
41
41
  ::
42
42
 
43
43
  ## Startup Errors
@@ -53,7 +53,7 @@ This includes:
53
53
 
54
54
  ## Nitro Server Errors
55
55
 
56
- You cannot currently define a server-side handler for these errors, but can render an error page, see the [Render an Error Page](#error-page) section.
56
+ You cannot currently define a server-side handler for these errors, but can render an error page, see the [Render an Error Page](/docs/3.x/getting-started/error-handling#error-page) section.
57
57
 
58
58
  ## Errors with JS Chunks
59
59
 
@@ -78,7 +78,7 @@ It can also occur on the client side when:
78
78
  - mounting your app if the error was not handled with `onErrorCaptured` or `vue:error` hook
79
79
  - the Vue app is initialized and mounted in browser (`app:mounted`).
80
80
 
81
- ::read-more{to="/docs/api/advanced/hooks"}
81
+ ::read-more{to="/docs/3.x/api/advanced/hooks"}
82
82
  Discover all the Nuxt lifecycle hooks.
83
83
  ::
84
84
 
@@ -99,7 +99,7 @@ const handleError = () => clearError({ redirect: '/' })
99
99
 
100
100
  <template>
101
101
  <div>
102
- <h2>{{ error?.statusCode }}</h2>
102
+ <h2>{{ error?.status }}</h2>
103
103
  <button @click="handleError">
104
104
  Clear errors
105
105
  </button>
@@ -128,7 +128,7 @@ Make sure to check before using anything dependent on Nuxt plugins, such as `$ro
128
128
  ::
129
129
 
130
130
  ::note
131
- Rendering an error page is an entirely separate page load, meaning any registered middleware will run again. You can use [`useError`](#useerror) in middleware to check if an error is being handled.
131
+ Rendering an error page is an entirely separate page load, meaning any registered middleware will run again. You can use [`useError`](/docs/3.x/getting-started/error-handling#useerror) in middleware to check if an error is being handled.
132
132
  ::
133
133
 
134
134
  ::note
@@ -140,25 +140,25 @@ If you are running on Node 16 and you set any cookies when rendering your error
140
140
  ### `useError`
141
141
 
142
142
  ```ts [TS Signature]
143
- function useError (): Ref<Error | { url, statusCode, statusMessage, message, description, data }>
143
+ function useError (): Ref<Error | { url, status, statusText, message, description, data }>
144
144
  ```
145
145
 
146
146
  This function will return the global Nuxt error that is being handled.
147
147
 
148
- ::read-more{to="/docs/api/composables/use-error"}
148
+ ::read-more{to="/docs/3.x/api/composables/use-error"}
149
149
  Read more about `useError` composable.
150
150
  ::
151
151
 
152
152
  ### `createError`
153
153
 
154
154
  ```ts [TS Signature]
155
- function createError (err: string | { cause, data, message, name, stack, statusCode, statusMessage, fatal }): Error
155
+ function createError (err: string | { cause, data, message, name, stack, status, statusText, fatal }): Error
156
156
  ```
157
157
 
158
158
  Create an error object with additional metadata. You can pass a string to be set as the error `message` or an object containing error properties. It is usable in both the Vue and Server portions of your app, and is meant to be thrown.
159
159
 
160
160
  If you throw an error created with `createError`:
161
- - on server-side, it will trigger a full-screen error page which you can clear with [`clearError`](#clearerror).
161
+ - on server-side, it will trigger a full-screen error page which you can clear with [`clearError`](/docs/3.x/getting-started/error-handling#clearerror).
162
162
  - on client-side, it will throw a non-fatal error for you to handle. If you need to trigger a full-screen error page, then you can do this by setting `fatal: true`.
163
163
 
164
164
  ```vue twoslash [pages/movies/[slug\\].vue]
@@ -168,28 +168,34 @@ const { data } = await useFetch(`/api/movies/${route.params.slug}`)
168
168
 
169
169
  if (!data.value) {
170
170
  throw createError({
171
- statusCode: 404,
172
- statusMessage: 'Page Not Found',
171
+ status: 404,
172
+ statusText: 'Page Not Found',
173
173
  })
174
174
  }
175
175
  </script>
176
176
  ```
177
177
 
178
- ::read-more{to="/docs/api/utils/create-error"}
178
+ ::tip
179
+ The `statusText` property is intended for short, HTTP-compliant status texts (e.g., "Not Found"). It should only contain horizontal tabs, spaces, and visible ASCII characters (`[\t\u0020-\u007E]`).
180
+
181
+ For any detailed descriptions, multi-line messages, or content with non-ASCII characters, you should always use the `message` property instead.
182
+ ::
183
+
184
+ ::read-more{to="/docs/3.x/api/utils/create-error"}
179
185
  Read more about `createError` util.
180
186
  ::
181
187
 
182
188
  ### `showError`
183
189
 
184
190
  ```ts [TS Signature]
185
- function showError (err: string | Error | { statusCode, statusMessage }): Error
191
+ function showError (err: string | Error | { status, statusText }): Error
186
192
  ```
187
193
 
188
- You can call this function at any point on client-side, or (on server side) directly within middleware, plugins or `setup()` functions. It will trigger a full-screen error page which you can clear with [`clearError`](#clearerror).
194
+ You can call this function at any point on client-side, or (on server side) directly within middleware, plugins or `setup()` functions. It will trigger a full-screen error page which you can clear with [`clearError`](/docs/3.x/getting-started/error-handling#clearerror).
189
195
 
190
196
  It is recommended instead to use `throw createError()`.
191
197
 
192
- ::read-more{to="/docs/api/utils/show-error"}
198
+ ::read-more{to="/docs/3.x/api/utils/show-error"}
193
199
  Read more about `showError` util.
194
200
  ::
195
201
 
@@ -201,7 +207,7 @@ function clearError (options?: { redirect?: string }): Promise<void>
201
207
 
202
208
  This function will clear the currently handled Nuxt error. It also takes an optional path to redirect to (for example, if you want to navigate to a 'safe' page).
203
209
 
204
- ::read-more{to="/docs/api/utils/clear-error"}
210
+ ::read-more{to="/docs/3.x/api/utils/clear-error"}
205
211
  Read more about `clearError` util.
206
212
  ::
207
213
 
@@ -232,4 +238,4 @@ If you navigate to another route, the error will be cleared automatically.
232
238
  </template>
233
239
  ```
234
240
 
235
- :link-example{to="/docs/examples/advanced/error-handling"}
241
+ :link-example{to="/docs/3.x/examples/advanced/error-handling"}
@@ -4,7 +4,7 @@ description: Build full-stack applications with Nuxt's server framework. You can
4
4
  navigation.icon: i-lucide-pc-case
5
5
  ---
6
6
 
7
- :read-more{to="/docs/guide/directory-structure/server"}
7
+ :read-more{to="/docs/3.x/directory-structure/server"}
8
8
 
9
9
  ## Powered by Nitro
10
10
 
@@ -38,7 +38,7 @@ And you can directly return `text`, `json`, `html` or even a `stream`.
38
38
 
39
39
  Out-of-the-box, it supports **hot module replacement** and **auto-import** like the other parts of your Nuxt application.
40
40
 
41
- :read-more{to="/docs/guide/directory-structure/server"}
41
+ :read-more{to="/docs/3.x/directory-structure/server"}
42
42
 
43
43
  ## Universal Deployment
44
44
 
@@ -49,17 +49,17 @@ Nitro offers the ability to deploy your Nuxt app anywhere, from a bare metal ser
49
49
  There are more than 15 presets to build your Nuxt app for different cloud providers and servers, including:
50
50
 
51
51
  - [Cloudflare Workers](https://workers.cloudflare.com)
52
- - [Netlify Functions](https://www.netlify.com/products/functions)
53
- - [Vercel Edge Network](https://vercel.com/docs/edge-network)
52
+ - [Netlify Functions](https://www.netlify.com/platform/core/functions/)
53
+ - [Vercel Cloud](https://vercel.com/home)
54
54
 
55
55
  Or for other runtimes:
56
56
 
57
57
  ::card-group
58
- :card{icon="i-logos-deno" title="Deno" to="https://deno.land" target="_blank"}
59
- :card{icon="i-logos-bun" title="Bun" to="https://bun.sh" target="_blank"}
58
+ :card{icon="i-logos-deno" title="Deno" to="https://deno.com" target="_blank"}
59
+ :card{icon="i-logos-bun" title="Bun" to="https://bun.com" target="_blank"}
60
60
  ::
61
61
 
62
- :read-more{to="/docs/getting-started/deployment"}
62
+ :read-more{to="/docs/3.x/getting-started/deployment"}
63
63
 
64
64
  ## Hybrid Rendering
65
65
 
@@ -81,7 +81,7 @@ export default defineNuxtConfig({
81
81
  })
82
82
  ```
83
83
 
84
- ::read-more{to="/docs/guide/concepts/rendering#hybrid-rendering"}
84
+ ::read-more{to="/docs/3.x/guide/concepts/rendering#hybrid-rendering"}
85
85
  Learn about all available route rules are available to customize the rendering mode of your routes.
86
86
  ::
87
87
 
@@ -91,4 +91,4 @@ Some route rules (`appMiddleware`, `redirect` and `prerender`) also affect clien
91
91
 
92
92
  Nitro is used to build the app for server side rendering, as well as pre-rendering.
93
93
 
94
- :read-more{to="/docs/guide/concepts/rendering"}
94
+ :read-more{to="/docs/3.x/guide/concepts/rendering"}
@@ -56,6 +56,10 @@ export default defineNuxtConfig({
56
56
  })
57
57
  ```
58
58
 
59
+ ::note
60
+ If a branch is not specified, this will clone `main`.
61
+ ::
62
+
59
63
  ::tip
60
64
  You can override a layer's alias by specifying it in the options next to the layer source.
61
65
 
@@ -76,38 +80,66 @@ export default defineNuxtConfig({
76
80
 
77
81
  ::
78
82
 
79
- Nuxt uses [unjs/c12](https://c12.unjs.io) and [unjs/giget](https://giget.unjs.io) for extending remote layers. Check the documentation for more information and all available options.
83
+ Nuxt uses [unjs/c12](https://github.com/unjs/c12) and [unjs/giget](https://github.com/unjs/giget) for extending remote layers. Check the documentation for more information and all available options.
80
84
 
81
85
  ## Layer Priority
82
86
 
83
87
  When using multiple layers, it's important to understand the override order. Layers with **higher priority** override layers with lower priority when they define the same files or components.
84
88
 
85
- The priority order from highest to lowest is:
89
+ ### Priority Order
90
+
91
+ From highest to lowest priority:
86
92
 
87
93
  1. **Your project files** - always have the highest priority
88
94
  2. **Auto-scanned layers** from `~~/layers` directory - sorted alphabetically (Z has higher priority than A)
89
95
  3. **Layers in `extends`** config - first entry has higher priority than second
90
96
 
91
- ### When to Use Each
97
+ ### Practical Example
92
98
 
93
- - **`extends`** - Use for external dependencies (npm packages, remote repositories) or layers outside your project directory
94
- - **`~~/layers` directory** - Use for local layers that are part of your project
99
+ Consider multiple layers defining the same component:
100
+
101
+ ```bash [Directory structure]
102
+ layers/
103
+ 1.base/
104
+ components/Button.vue # Base button style
105
+ 2.theme/
106
+ components/Button.vue # Themed button (overrides base)
107
+ app/
108
+ components/Button.vue # Project button (overrides all layers)
109
+ ```
110
+
111
+ In this case:
112
+ - If only layers exist, `2.theme/Button.vue` is used (higher alphabetically)
113
+ - If `components/Button.vue` exists in your project, it overrides all layers
114
+
115
+ ### Controlling Priority
116
+
117
+ You can prefix layer directories with numbers to control the order:
118
+
119
+ ```bash [Directory structure]
120
+ layers/
121
+ 1.base/ # Lowest priority
122
+ 2.features/ # Medium priority
123
+ 3.admin/ # Highest priority (among layers)
124
+ ```
95
125
 
96
126
  ::tip
97
- If you need to control the order of auto-scanned layers, you can prefix them with numbers: `~/layers/1.z-layer`, `~/layers/2.a-layer`. This way `2.a-layer` will have higher priority than `1.z-layer`.
127
+ This pattern is useful for creating base layers with defaults that can be progressively overridden by more specific layers.
98
128
  ::
99
129
 
100
- ### Example
130
+ ### When to Use Each
131
+
132
+ - **`~~/layers` directory** - Use for local layers that are part of your project
133
+ - **`extends`** - Use for external dependencies (npm packages, remote repositories) or layers outside your project directory
134
+
135
+ ### Full Example with extends
101
136
 
102
137
  ```ts [nuxt.config.ts]
103
138
  export default defineNuxtConfig({
104
139
  extends: [
105
- // Local layer outside the project
106
- '../base',
107
- // NPM package
108
- '@my-themes/awesome',
109
- // Remote repository
110
- 'github:my-themes/awesome#v1',
140
+ '../base', // Local layer outside project
141
+ '@my-themes/awesome', // NPM package
142
+ 'github:my-themes/awesome#v1', // Remote repository
111
143
  ],
112
144
  })
113
145
  ```
@@ -119,9 +151,11 @@ If you also have `~~/layers/custom`, the priority order is:
119
151
  - `@my-themes/awesome`
120
152
  - `github:my-themes/awesome#v1` (lowest)
121
153
 
122
- This means your project files will override any layer, and `~~/layers/custom` will override anything in `extends`.
154
+ ::read-more{to="/docs/3.x/directory-structure/layers"}
155
+ Learn about the **layers/ directory** to organize and share reusable code, components, composables, and configurations across your Nuxt application.
156
+ ::
123
157
 
124
- ::read-more{to="/docs/guide/going-further/layers"}
158
+ ::read-more{to="/docs/3.x/guide/going-further/layers"}
125
159
  Read more about layers in the **Layer Author Guide**.
126
160
  ::
127
161
 
@@ -6,7 +6,7 @@ navigation.icon: i-lucide-file-code-2
6
6
 
7
7
  Nuxt allows for select pages from your application to be rendered at build time. Nuxt will serve the prebuilt pages when requested instead of generating them on the fly.
8
8
 
9
- :read-more{title="Nuxt rendering modes" to="/docs/guide/concepts/rendering"}
9
+ :read-more{title="Nuxt rendering modes" to="/docs/3.x/guide/concepts/rendering"}
10
10
 
11
11
  ## Crawl-based Pre-rendering
12
12
 
@@ -32,6 +32,10 @@ pnpm nuxt generate
32
32
  bun x nuxt generate
33
33
  ```
34
34
 
35
+ ```bash [deno]
36
+ deno x nuxt generate
37
+ ```
38
+
35
39
  ::
36
40
 
37
41
  You can now deploy the `.output/public` directory to any static hosting service or preview it locally with `npx serve .output/public`.
@@ -45,7 +49,15 @@ Working of the Nitro crawler:
45
49
 
46
50
  This is important to understand since pages that are not linked to a discoverable page can't be pre-rendered automatically.
47
51
 
48
- ::read-more{to="/docs/api/commands/generate#nuxt-generate"}
52
+ ### Payload Extraction
53
+
54
+ Nuxt generates `_payload.json` alongside HTML for:
55
+ - Prerendered routes (at build time)
56
+ - ISR/SWR routes (on first request)
57
+
58
+ Payloads contain serialized data from `useAsyncData` and `useFetch`. Client-side navigation loads these cached payloads instead of re-fetching data. Configure dynamic routes like `pages/[...slug].vue` with route rules: `'/**': { isr: true }`.
59
+
60
+ ::read-more{to="/docs/3.x/api/commands/generate#nuxt-generate"}
49
61
  Read more about the `nuxt generate` command.
50
62
  ::
51
63
 
@@ -54,6 +66,7 @@ Read more about the `nuxt generate` command.
54
66
  You can manually specify routes that [Nitro](/docs/3.x/guide/concepts/server-engine) will fetch and pre-render during the build or ignore routes that you don't want to pre-render like `/dynamic` in the `nuxt.config` file:
55
67
 
56
68
  ```ts twoslash [nuxt.config.ts]
69
+ // @errors: 2353
57
70
  export default defineNuxtConfig({
58
71
  nitro: {
59
72
  prerender: {
@@ -67,6 +80,7 @@ export default defineNuxtConfig({
67
80
  You can combine this with the `crawlLinks` option to pre-render a set of routes that the crawler can't discover like your `/sitemap.xml` or `/robots.txt`:
68
81
 
69
82
  ```ts twoslash [nuxt.config.ts]
83
+ // @errors: 2353
70
84
  export default defineNuxtConfig({
71
85
  nitro: {
72
86
  prerender: {
@@ -105,7 +119,7 @@ Read more about Nitro's `routeRules` configuration.
105
119
 
106
120
  As a shorthand, you can also configure this in a page file using [`defineRouteRules`](/docs/3.x/api/utils/define-route-rules).
107
121
 
108
- ::read-more{to="/docs/guide/going-further/experimental-features#inlinerouterules" icon="i-lucide-star"}
122
+ ::read-more{to="/docs/3.x/guide/going-further/experimental-features#inlinerouterules" icon="i-lucide-star"}
109
123
  This feature is experimental and in order to use it you must enable the `experimental.inlineRouteRules` option in your `nuxt.config`.
110
124
  ::
111
125
 
@@ -154,7 +168,7 @@ prerenderRoutes('/api/content/article/my-article')
154
168
  </template>
155
169
  ```
156
170
 
157
- :read-more{title="prerenderRoutes" to="/docs/api/utils/prerender-routes"}
171
+ :read-more{title="prerenderRoutes" to="/docs/3.x/api/utils/prerender-routes"}
158
172
 
159
173
  ### `prerender:routes` Nuxt hook
160
174
 
@@ -73,7 +73,7 @@ There are two ways to deploy a Nuxt application to any static hosting services:
73
73
  - Static site generation (SSG) with `ssr: true` pre-renders routes of your application at build time. (This is the default behavior when running `nuxt generate`.) It will also generate `/200.html` and `/404.html` single-page app fallback pages, which can render dynamic routes or 404 errors on the client (though you may need to configure this on your static host).
74
74
  - Alternatively, you can prerender your site with `ssr: false` (static single-page app). This will produce HTML pages with an empty `<div id="__nuxt"></div>` where your Vue app would normally be rendered. You will lose many SEO benefits of prerendering your site, so it is suggested instead to use [`<ClientOnly>`](/docs/3.x/api/components/client-only) to wrap the portions of your site that cannot be server rendered (if any).
75
75
 
76
- :read-more{title="Nuxt prerendering" to="/docs/getting-started/prerendering"}
76
+ :read-more{title="Nuxt prerendering" to="/docs/3.x/getting-started/prerendering"}
77
77
 
78
78
  ### Client-side Only Rendering
79
79
 
@@ -98,6 +98,7 @@ In addition to Node.js servers and static hosting services, a Nuxt project can b
98
98
  You can explicitly set the desired preset in the [`nuxt.config.ts`](/docs/3.x/directory-structure/nuxt-config) file:
99
99
 
100
100
  ```ts twoslash [nuxt.config.ts]
101
+ // @errors: 2353
101
102
  export default defineNuxtConfig({
102
103
  nitro: {
103
104
  preset: 'node-server',
@@ -5,7 +5,7 @@ navigation.icon: i-lucide-circle-check
5
5
  ---
6
6
 
7
7
  ::tip
8
- If you are a module author, you can find more specific information in the [Module Author's guide](/docs/3.x/guide/going-further/modules#testing).
8
+ If you are a module author, you can find more specific information in the [Module Author's guide](/docs/3.x/guide/modules/testing).
9
9
  ::
10
10
 
11
11
  Nuxt offers first-class support for end-to-end and unit testing of your Nuxt application via `@nuxt/test-utils`, a library of test utilities and configuration that currently powers the [tests we use on Nuxt itself](https://github.com/nuxt/nuxt/tree/main/test) and tests throughout the module ecosystem.
@@ -63,7 +63,14 @@ We currently ship an environment for unit testing code that needs a [Nuxt](https
63
63
  {
64
64
  test: {
65
65
  name: 'unit',
66
- include: ['test/{e2e,unit}/*.{test,spec}.ts'],
66
+ include: ['test/unit/*.{test,spec}.ts'],
67
+ environment: 'node',
68
+ },
69
+ },
70
+ {
71
+ test: {
72
+ name: 'e2e',
73
+ include: ['test/e2e/*.{test,spec}.ts'],
67
74
  environment: 'node',
68
75
  },
69
76
  },
@@ -265,7 +272,7 @@ it('can also mount an app', async () => {
265
272
 
266
273
  `renderSuspended` allows you to render any Vue component within the Nuxt environment using `@testing-library/vue`, allowing async setup and access to injections from your Nuxt plugins.
267
274
 
268
- This should be used together with utilities from Testing Library, e.g. `screen` and `fireEvent`. Install [@testing-library/vue](https://testing-library.com/docs/vue-testing-library/intro) in your project to use these.
275
+ This should be used together with utilities from Testing Library, e.g. `screen` and `fireEvent`. Install [@testing-library/vue](https://testing-library.com/docs/vue-testing-library/intro/) in your project to use these.
269
276
 
270
277
  Additionally, Testing Library also relies on testing globals for cleanup. You should turn these on in your [Vitest config](https://vitest.dev/config/globals).
271
278
 
@@ -330,10 +337,10 @@ mockNuxtImport('useStorage', () => {
330
337
  ```
331
338
 
332
339
  ::note
333
- `mockNuxtImport` can only be used once per mocked import per test file. It is actually a macro that gets transformed to `vi.mock` and `vi.mock` is hoisted, as described [in the Vitest docs](https://vitest.dev/api/vi.html#vi-mock).
340
+ `mockNuxtImport` can only be used once per mocked import per test file. It is actually a macro that gets transformed to `vi.mock` and `vi.mock` is hoisted, as described [in the Vitest docs](https://vitest.dev/api/vi#vi-mock).
334
341
  ::
335
342
 
336
- If you need to mock a Nuxt import and provide different implementations between tests, you can do it by creating and exposing your mocks using [`vi.hoisted`](https://vitest.dev/api/vi.html#vi-hoisted), and then use those mocks in `mockNuxtImport`. You then have access to the mocked imports, and can change the implementation between tests. Be careful to [restore mocks](https://vitest.dev/api/mock.html#mockrestore) before or after each test to undo mock state changes between runs.
343
+ If you need to mock a Nuxt import and provide different implementations between tests, you can do it by creating and exposing your mocks using [`vi.hoisted`](https://vitest.dev/api/vi#vi-hoisted), and then use those mocks in `mockNuxtImport`. You then have access to the mocked imports, and can change the implementation between tests. Be careful to [restore mocks](https://vitest.dev/api/mock#mockrestore) before or after each test to undo mock state changes between runs.
337
344
 
338
345
  ```ts twoslash
339
346
  import { vi } from 'vitest'
@@ -624,7 +631,7 @@ Please use the options below for the `setup` method.
624
631
  - Type: `number | undefined`
625
632
  - Default: `undefined`
626
633
 
627
- - `host`: If provided, a URL to use as the test target instead of building and running a new server. Useful for running "real" end-to-end tests against a deployed version of your application, or against an already running local server (which may provide a significant reduction in test execution timings). See the [target host end-to-end example below](#target-host-end-to-end-example).
634
+ - `host`: If provided, a URL to use as the test target instead of building and running a new server. Useful for running "real" end-to-end tests against a deployed version of your application, or against an already running local server (which may provide a significant reduction in test execution timings). See the [target host end-to-end example below](/docs/3.x/getting-started/testing#target-host-end-to-end-example).
628
635
  - Type: `string`
629
636
  - Default: `undefined`
630
637
 
@@ -647,7 +654,7 @@ For local development or automated deploy pipelines, testing against a separate
647
654
 
648
655
  To utilize a separate target host for end-to-end tests, simply provide the `host` property of the `setup` function with the desired URL.
649
656
 
650
- ```ts twoslash
657
+ ```ts
651
658
  import { createPage, setup } from '@nuxt/test-utils/e2e'
652
659
  import { describe, expect, it } from 'vitest'
653
660
 
@@ -730,6 +737,9 @@ pnpm add -D @playwright/test @nuxt/test-utils
730
737
  ```bash [bun]
731
738
  bun add --dev @playwright/test @nuxt/test-utils
732
739
  ```
740
+ ```bash [deno]
741
+ deno add --dev npm:@playwright/test npm:@nuxt/test-utils
742
+ ```
733
743
  ::
734
744
 
735
745
  You can provide global Nuxt configuration, with the same configuration details as the `setup()` function mentioned earlier in this section.