laurent22/joplin · error · Error

${errorPrefix}: Field "output" is not an object

Error message

${errorPrefix}: Field "output" is not an object

What it means

Thrown by `WhisperConfig.processOutputSettings` when the `output` field is present but not an object. `output` is expected to be a container for `stringReplacements` and `regexReplacements`.

Source

Thrown at packages/app-mobile/services/voiceTyping/whisper.ts:39

		if (typeof json !== 'object') throw new Error('Whisper config is not an object');

		const processPrompts = () => {
			if (!('prompts' in json)) return;
			if (typeof json.prompts !== 'object') {
				throw new Error(`${errorPrefix}: Field "prompts" is not an object`);
			}

			for (const [key, value] of Object.entries(json.prompts)) {
				if (typeof value !== 'string') {
					throw new Error(`${errorPrefix}: Value for key ${key} is ${typeof value}, not string.`);
				}
				this.prompts.set(key, value);
			}
		};
		const processOutputSettings = () => {
			if (!('output' in json)) return;
			if (typeof json.output !== 'object') {
				throw new Error(`${errorPrefix}: Field "output" is not an object`);
			}

			const getReplacements = (key: string, value: unknown) => {
				if (!Array.isArray(value)) {
					throw new Error(`${errorPrefix}: ${key} must be an array`);
				}

				const results: [string, string][] = [];
				for (const replacement of value) {
					if (!Array.isArray(replacement)) {
						throw new Error(`${errorPrefix}: values for ${key} must be arrays`);
					}
					if (typeof replacement[0] !== 'string' || typeof replacement[1] !== 'string') {
						throw new Error(`${errorPrefix}: values for ${key} must be pairs of strings`);
					}

					results.push([replacement[0], replacement[1]]);
				}

View on GitHub (pinned to 2654b33620)

Solutions

  1. Restructure config so `output` is an object: `{ "output": { "stringReplacements": [...] } }`.
  2. Re-download the model bundle.
  3. Schema-validate before shipping custom configs.

Example fix

// before
"output": [...]

// after
"output": { "stringReplacements": [] }
Defensive patterns

Strategy: validation

Validate before calling

if ('output' in config && (typeof config.output !== 'object' || config.output === null || Array.isArray(config.output))) {
  throw new Error('Whisper config: output must be an object');
}

Type guard

const isOutputObject = (v: unknown): v is Record<string, unknown> =>
  !!v && typeof v === 'object' && !Array.isArray(v);

Try / catch

null

Prevention

When it happens

Trigger: Parsed config has `"output": "..."` or `"output": [...]` or any non-object value. Triggered after the top-level object check and once `processOutputSettings` runs.

Common situations: Hand-edited config; misnamed field; legacy format that put replacements at the top level instead of under `output`.

Related errors


AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12). Data as JSON: /api/errors/12a97613b3e6263d. Report an issue: GitHub.