# Input-error code `'duplicate-node-id'`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts`, `tables/problems.json` and `services/onsite-scripter/scripts/contract-docs-what-to-do.json` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

A member of [`InputErrorCode`](../api/InputErrorCode.md) · stable · since 2.0.0

Two nodes share a `nodeId` (ID9); [`normalizeNodeIds`](../api/normalizeNodeIds.md) repairs an old save.

## What to do

A copied node keeps its `nodeId`: copy nodes with [`duplicateNodes(nodes, { reserved })`](../api/duplicateNodes.md), which gives the copies new ids, and repair an old save with [`normalizeNodeIds(doc)`](../api/normalizeNodeIds.md) (use its `doc`).

```ts
const model = session.getSceneModel();
const { nodes } = duplicateNodes([shelf], { reserved: ids });
if (model) await session.setSceneModel({ ...model, root: [...model.root, ...nodes] });
```

## Where the declaration names it

- [`IConfiguratorNode.nodeId`](../api/IConfiguratorNode.nodeId.md): A missing or repeated id rejects the write with HoloInputError 'missing-node-id' / 'duplicate-node-id' at the call.
- [`Writer.setSceneModel`](../api/Writer.setSceneModel.md): Errors: rejects HoloInputError 'missing-node-id' or 'duplicate-node-id'.

The set is open: handle a code you don't know (`'other'`).
