Slot Component Rendering Errors
Problem description
During page rendering in the lowcode engine, you may see an error about the Slot component—"Slot not found". In render mode, the Slot component should not be used.
Cause
Lowcode engine rendering has two modes: design mode and render mode.
- Design mode: The Slot component is introduced to support visual design of slots.
- Render mode: The Slot component is not needed.
This issue usually occurs when a design-mode schema is used incorrectly in render mode.
Solution
- Distinguish design mode and render mode: Use the argument to
project.exportSchema(TransformStage.Save)to distinguish them.TransformStage.Saverepresents the render-mode schema, which does not include Slot components.- [Default]
TransformStage.Renderrepresents the design-mode schema, which includes Slot components.
- Use the correct API and arguments: In render mode, use the correct schema and avoid referencing design-mode Slot components.
- Handle stale data: If stale data caused the issue, clear the data and drag components again to recover.
Notes
- Ensure design mode and render mode are distinguished correctly in code and configuration.
- If the problem persists, check for stale data or misconfiguration and clean up accordingly.
Related links
- Issue: Issue #1798