Lattice Grid Buy a licence

The grid (core) ยท console.warn

defaults() expects a configuration object wi...

Printed by The grid (core), prefixed [lattice], since 1.77.0.

Warnings reference › defaults:cyclic

Identifier
defaults:cyclic
Raised by
The grid (core)
Since
1.77.0

What happened

defaults() snapshots the object you pass by walking into every plain object it contains, so it can hand each grid its own independent copy. An object that refers back to one of its own ancestors cannot be walked at all, so the call is refused the same way a non-object argument is, instead of exhausting the call stack. A value merely *shared* between two branches (not a cycle) is unaffected.

The fix

Remove the back-reference from the object you pass to defaults(), or restructure it so nothing points back at an ancestor.

The smallest fix

const house = { theme: 'navy' };
house.self = house; // refused
defaults(house);

Reference

Covered in full at the API reference.