Web component · console.warn
<lattice-router>: `config` changed after the router was built. Nothing was applied and the router was NOT rebuilt - rebuilding it would detach every grid and drop every row it holds. Replace the <lattice-router> element itself when a genuinely different router is wanted.
Printed by Web component, prefixed [lattice], since 1.66.0.
Warnings reference › webcomponent.router.mountOnly.config
- Identifier
webcomponent.router.mountOnly.config- Raised by
- Web component
- Since
- 1.66.0
What happened
The config property of a <lattice-router> element was written after the element had already built its router. The router holds the attached grids and the rows in flight between them, so re-reading its configuration would mean tearing all of that down; the element merges the value into its own stored configuration for anyone reading the property back, but the live router keeps the configuration it started with.
The fix
Set config before the element connects, or remove the element and insert a fresh one when the router really must change.
The smallest fix
const el = document.createElement('lattice-router');
el.config = { sources: { … } }; // before insertion
document.body.append(el);
Reference
Covered in full at the API reference.