<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[qt_add_qml_module code works for desktop but not for wasm]]></title><description><![CDATA[<h1>Create main UI module</h1>
<p dir="auto">qt_add_qml_module(UiLib<br />
URI "UI"<br />
VERSION 1.0<br />
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qml_modules/UI<br />
QML_FILES<br />
qml/Main.qml<br />
qml/login/LoginWindow.qml<br />
qml/login/LoginView.qml<br />
qml/login/RegisterView.qml<br />
qml/login/ForgotPasswordView.qml<br />
qml/login/EmailVerificationView.qml<br />
qml/login/LoginGlowOrbs.qml<br />
qml/login/LoginBorderOrbs.qml<br />
IMPORTS<br />
QtQuick<br />
QtQuick.Controls<br />
QtQuick.Dialogs<br />
QtQuick.Layouts<br />
QtMultimedia<br />
)</p>
<p dir="auto">loadFromModule("UI", "Main")</p>
<p dir="auto">the loadFromModule works for my desktop build but not in the browser for some reason</p>
<p dir="auto">the files are reachable through their qrc:/ path (qrc:/qt/qml/qml/Main.qml, etc)  but not as modules.</p>
<p dir="auto">dealing with these qrc paths is just too great of an hassle, importing, lsp and linting into code make me feel like I am doing surgery in mud with a kitchen knife and toothpicks</p>
]]></description><link>https://forum.qt.io/topic/164265/qt_add_qml_module-code-works-for-desktop-but-not-for-wasm</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 08:45:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164265.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Feb 2026 16:49:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to qt_add_qml_module code works for desktop but not for wasm on Sun, 15 Feb 2026 12:29:20 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
please format your code, using the &lt;/&gt; code formatting tags. It makes just so much easier to read.<br />
WASM is a bit stricter than other OSes when it comes to deployment and embedded resources.<br />
Most certainly adding</p>
<pre><code>RESOURCE_PREFIX /qt/qml
</code></pre>
<p dir="auto">right above the imports will solve the problem.</p>
]]></description><link>https://forum.qt.io/post/836304</link><guid isPermaLink="true">https://forum.qt.io/post/836304</guid><dc:creator><![CDATA[Axel Spoerl]]></dc:creator><pubDate>Sun, 15 Feb 2026 12:29:20 GMT</pubDate></item></channel></rss>