> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Siwe Errors

:::info
`Siwe` is a re-export of ox's [`Siwe`](https://oxlib.sh/api/Siwe/errors). Refer to the ox documentation for the full reference.
:::

## `Siwe.InvalidMessageFieldError`

Thrown when a field in a SIWE Message is invalid.

### Examples

```ts twoslash
// @noErrors
import { Siwe } from 'viem/utils'

Siwe.createMessage({
  address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
  chainId: 1.1,
  domain: 'example.com',
  nonce: 'foobarbaz',
  uri: 'https://example.com/path',
  version: '1'
})
// @error: Siwe.InvalidMessageFieldError: Invalid Sign-In with Ethereum message field "chainId".
// @error: - Chain ID must be a EIP-155 chain ID.
// @error: - See https://eips.ethereum.org/EIPS/eip-155
// @error: Provided value: 1.1
```
