Assertion Error #741
Replies: 3 comments 4 replies
-
My guess is that this is related to one of two things. Either an outdated client version, or it's related to routing changes that were made. Take a look at the changelog entry here: https://idom-docs.herokuapp.com/docs/about/changelog.html#v0-38-0-a2 |
Beta Was this translation helpful? Give feedback.
-
OK I noticed the embedding script has also changed, but looking into the documentation, I think I will continue to work on this. import {
LayoutServerInfo,
mountLayoutWithWebSocket,
} from "https://esm.sh/idom-client-react@0.38.0";
// queryParams
const queryParams = (() => {
const reservedParams = new URLSearchParams();
const userParams = new URLSearchParams(window.location.search);
const reservedParamNames = ["noReconnect"];
reservedParamNames.forEach((name) => {
const value = userParams.get(name);
if (value !== null) {
reservedParams.append(name, userParams.get(name));
userParams.delete(name);
}
});
return {
reserved: reservedParams,
user: userParams,
};
})();
const serverInfo = new LayoutServerInfo({
host: document.location.hostname,
port: document.location.port,
path: "_idom",
query: queryParams.user.toString(),
secure: document.location.protocol == "https:",
});
console.log(serverInfo)
mountLayoutWithWebSocket(document.getElementById("idom-app"), serverInfo); |
Beta Was this translation helpful? Give feedback.
-
OK, reading through the IDOM javascript source code I could figure it out. There are a few mistake in the new docs embed js script. This is the correct script: import {
LayoutServerInfo,
mountWithLayoutServer,
} from "https://esm.sh/idom-client-react@0.38.1";
const serverInfo = new LayoutServerInfo({
host: document.location.hostname,
port: document.location.port,
path: "/_idom",
//query: queryParams.user.toString(),
secure: document.location.protocol == "https:",
});
mountWithLayoutServer(
document.getElementById("idom-app"),
serverInfo
); most importantly |
Beta Was this translation helpful? Give feedback.
-
Migrating to
0.38.1
causes this error:Beta Was this translation helpful? Give feedback.
All reactions