Variable: NubbinIssueCode
constNubbinIssueCode:object
Defined in: packages/core/src/NubbinIssueCode.ts:29
Every reason Nubbin refuses something, as a value to branch on rather than a string to match.
Compare it against NubbinIssue.code or NubbinError.code; a typo in a member name is a
compile error, where a typo in a string literal is a branch that never runs.
Each member's value is its own name in kebab-case, so a serialized issue reads the same in a log as it does in code. Scripts and editors match on these names, so every member below says what raises it and what has to change to satisfy it.
Type Declaration
ArtifactNotStored
readonlyArtifactNotStored:"artifact-not-stored"="artifact-not-stored"
A publish names a hash the store does not hold. Write the artifact before pointing a route at it.
BlockNotLoaded
readonlyBlockNotLoaded:"block-not-loaded"="block-not-loaded"
@nubbin/react: the block registry has no importer for a block the artifact names.
BlockVersion
readonlyBlockVersion:"block-version"="block-version"
defineBlock was given a version that is not an integer of 1 or more.
Cycle
readonlyCycle:"cycle"="cycle"
A node reaches back to one of its own ancestors, so the graph cannot flatten into a tree.
DanglingChild
readonlyDanglingChild:"dangling-child"="dangling-child"
A slot or a roots entry references an id that elements does not hold.
DuplicateBlockName
readonlyDuplicateBlockName:"duplicate-block-name"="duplicate-block-name"
createRegistry was given two blocks claiming one name — the identity every node resolves through.
DuplicateNodeId
readonlyDuplicateNodeId:"duplicate-node-id"="duplicate-node-id"
addNode was given an id the document already uses. Reusing one would replace a node and
redirect every slot that named it.
HintNotAddressable
readonlyHintNotAddressable:"hint-not-addressable"="hint-not-addressable"
defineCatalog found a data hint with no single target: a path through [], which names
every member of an array, or two hints whose paths nest and would write one value twice.
HintPathUnresolvable
readonlyHintPathUnresolvable:"hint-path-unresolvable"="hint-path-unresolvable"
defineCatalog found ui.fields naming a path the schema does not define. Check the spelling against the schema.
InvalidDefaults
readonlyInvalidDefaults:"invalid-defaults"="invalid-defaults"
defineCatalog found an entry's defaults do not satisfy that entry's own schema.
InvalidProps
readonlyInvalidProps:"invalid-props"="invalid-props"
A node's props failed its schema, or parsed to something other than an object. path names
the offending field.
InvalidRoute
readonlyInvalidRoute:"invalid-route"="invalid-route"
A route no request could match — no leading slash, a trailing slash, an empty or malformed
segment, or a * that is not the last one. Raised by compile and by parseMatchKind.
NoHoleResolver
readonlyNoHoleResolver:"no-hole-resolver"="no-hole-resolver"
@nubbin/react: a node declares holes and the render was given no resolveHole.
NoJsonSchema
readonlyNoJsonSchema:"no-json-schema"="no-json-schema"
A schema exposes no Standard JSON Schema converter, which field introspection needs — the studio reads a block's fields through it.
NoRoots
readonlyNoRoots:"no-roots"="no-roots"
The document's roots is empty, so it names no entry element and there is no tree to build.
NoSuchNode
readonlyNoSuchNode:"no-such-node"="no-such-node"
setNodeProp, addNode, removeNode or moveNode named a node id no element backs.
NotOneHostElement
readonlyNotOneHostElement:"not-one-host-element"="not-one-host-element"
@nubbin/react: a block returned a Fragment, a composite, or several roots where one host element is required.
NotStandardSchema
readonlyNotStandardSchema:"not-standard-schema"="not-standard-schema"
A schema exposes no ~standard.validate, or answers with a promise. Validation is
synchronous at registration and at compile, so an async validator is refused rather than
awaited.
PathNotAddressable
readonlyPathNotAddressable:"path-not-addressable"="path-not-addressable"
A prop path with no single target: an empty segment, an [], or a descent into an array.
Raised by setAtPath and by setNodeProp.
SlotAllowUnknown
readonlySlotAllowUnknown:"slot-allow-unknown"="slot-allow-unknown"
createRegistry found a slot's allow naming a block no registered block answers to.
SlotBounds
readonlySlotBounds:"slot-bounds"="slot-bounds"
defineBlock was given a slot whose min is above its max, which no composition satisfies.
SlotMax
readonlySlotMax:"slot-max"="slot-max"
A slot holds more children than its max.
SlotMin
readonlySlotMin:"slot-min"="slot-min"
A slot holds fewer children than its min. An omitted slot holds zero.
SlotNotAllowed
readonlySlotNotAllowed:"slot-not-allowed"="slot-not-allowed"
A slot the block never declared, or a child the slot's allow list rejects.
UnknownBlock
readonlyUnknownBlock:"unknown-block"="unknown-block"
A node names a block neither the registry nor the catalog holds. Register the block, or
correct the node's block.
UnknownProp
readonlyUnknownProp:"unknown-prop"="unknown-prop"
A key the author wrote and the schema did not keep — almost always a typo, heading where
the schema says headline. Returned in CompileResult.issues, never thrown: the
artifact is valid and publishable without that key.
Unreachable
readonlyUnreachable:"unreachable"="unreachable"
No slot reaches the node from any root, so it would be dropped silently on compile.
Example
import { NubbinError, NubbinIssueCode } from "@nubbin/core";
try {
addNode(version, "section-1", "items", node);
} catch (error) {
if (error instanceof NubbinError && error.code === NubbinIssueCode.SlotMax) {
toast(`That slot is full: ${error.issues[0]?.at}`);
}
}