---
title: "NUXT_E6001"
description: "缺少 Unhead 实例。"
canonical_url: "https://nuxt.zhcndoc.com/docs/4.x/errors/e6001"
---
# E6001

像 `useHead()` 这样的 head 组合式函数在没有活动的 Unhead 实例时被调用了。当它运行在有效的 Nuxt 上下文之外时，就会发生这种情况，例如在 Nuxt 实例不再可用后的一个脱离的异步回调中。

## 解析

在组件 `setup()`、Nuxt 插件或路由中间件中同步调用 head 组合函数。如果你需要在 `await` 之后使用它们，请先捕获 Nuxt 上下文：

```ts
const nuxtApp = useNuxtApp()
await someAsyncWork()
nuxtApp.runWithContext(() => useHead({ title: 'Late title' }))
```


## Sitemap

See the full [sitemap](https://nuxt.zhcndoc.com/sitemap.md) for all pages.
