On this page

Type is instantiated recursively

This warning category is spelled [type-instantiated-recursively] by qmllint.

Type can't be instantiated recursively

What happened?

A component instantiated itself.

Why is this bad?

The component needs itself to instantiate itself, creating an infinite loop. The QML runtime will error out on this component.

Example

// MyComponent.qml
import QtQuick

Item {
    MyComponent {}
}

To fix this warning,

// MyComponent.qml
import QtQuick

Item {
    // solution 1: MyComponent was not needed here, use another type
    Item {}

    // solution 2: add a MyComponent property and set it later
    property MyComponent myChild
}

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.