---
title: "NUXT_E7009"
description: "useState key must be a string."
canonical_url: "https://nuxt.com/docs/4.x/errors/e7009"
---
# E7009

`useState()` was called with a key that is not a string. The key identifies the shared state across the app and in the hydration payload, so it must be a non-empty string.

## Resolution

```ts
const counter = useState('counter', () => 0)
```

<read-more to="https://nuxt.com/docs/4.x/api/composables/use-state">



</read-more>


## Sitemap

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