Skip to content
Lamina PDF
Unreleased

These docs describe changes that aren’t released yet. For the newest release, see the released docs.

unknown-option

All codes

  • Type: error
  • Kind: usage (the caller misused the API)

What happened

An options record passed to @laminapdf/wasm (OpenOptionsInit, SaveOptionsInit, BuildOptionsInit, …) has a key Lamina PDF doesn’t know.

Why

Records refuse unknown keys instead of ignoring them, so a misspelt option fails loudly rather than silently doing nothing.

How to fix

Remove the key or correct its spelling. didYouMean lists the known keys within two edits of it.

Example

WasmDocument.openBytes(bytes, { pasword: "secret" }); // throws { code: "unknown-option", didYouMean: ["password"], … }

Data fields

  • argument: the parameter whose record had the key (options, metadata, …).
  • option: the key given (untrusted: caller text, never in the message).