diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp
index 1f9b947881f2e308973b88c1149266362fa71eaa..685863512383837c85516ebc5bd40f3ac78092c9 100644
--- a/src/libs/qmljs/qmljslink.cpp
+++ b/src/libs/qmljs/qmljslink.cpp
@@ -308,9 +308,12 @@ bool Link::importLibrary(Document::Ptr doc, Interpreter::ObjectValue *import,
             ModelManagerInterface *modelManager = ModelManagerInterface::instance();
             if (modelManager) {
                 if (importInfo.type() == ImportInfo::LibraryImport) {
-                    modelManager->loadPluginTypes(
-                                libraryPath, importPath,
-                                importInfo.name(), version.toString());
+                    if (importInfo.version().isValid()) {
+                        const QString uri = importInfo.name().replace(QDir::separator(), QLatin1Char('.'));
+                        modelManager->loadPluginTypes(
+                                    libraryPath, importPath,
+                                    uri, version.toString());
+                    }
                 } else {
                     modelManager->loadPluginTypes(
                                 libraryPath, libraryPath,