Skip to content

HAMUR_E0019: app.head.titleTemplate is a function in the config

app.head.titleTemplate is a function in the config. Error HAMUR_E0019 belongs to hamur, config, environment and command line (0001 – 0999).

Message

text
HAMUR_E0019 app.head.titleTemplate must be a string in hamur.config.ts; use useHead({ titleTemplate }) for a function

Cause

app.head.titleTemplate is a function in hamur.config.ts. A function cannot be written to the build's data.

Fix

Use a string in the config, such as "%s - My app". Use useHead({ titleTemplate }) in a page or plugin for a function.

ts
import { defineConfig } from "hamur"

export default defineConfig({
  framework: "react",
  app: { head: { titleTemplate: "%s - My app" } },
})