-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded.js does not find mono-config.js #753
Comments
Looks like this might have been fixed by this change: I am guessing this is probably in a more recent -dev build? I'm more of a DevOps person so not familiar with github workflows. Is there a way to determine what release/version a particular commit or PR was included in? |
@SerratedSharp indeed, the fix for the embedded mode is included in the |
Using newest dev build it seems to be working now, no errors and the info body gets populated, but the white loading overlay doesn't disappear. Is it possible to give me a starter clue on what code controls detecting that loading is complete and hides/removes the overlay? I'd like to try and start getting familiar enough with the code base that I can troubleshoot myself. |
One thing I noticed is I am getting duplicate uno-body elements. The one I declare per embedded mode instructions, and then an additional one added by the embedded.js I don't know how the identifier The way other code like in the bootstrapper checks for the element is using |
So I removed my own When I step through embedded.js and uno-bootstrap.js, it looks like the loader doesn't get removed when progress is complete, but instead waits for a mutation of the body. If I run this code in console to add a blank div in the uno-body then it triggers the mutation observer to remove the loader. What is the bootstrapper's mutation observer watching for? I.e. when loading is complete, what would normally happen to trigger the mutation observer?
Repro, this is using .NET 8, latest dev build, WasmShellMode=BrowserEmbedded(set in build.props), and using my custom build.props to copy the wasm package into wwwroot(but I don't think this would effect how the javascript is handling the loader overlay): |
This portion of the loader is aligned with this part in Uno. You may find what we do with the splashscreen there, given that the observer is looking for changes in the body:
|
@jeromelaban Any thoughts on the duplicate uno-body? It seems logical that Browser Embedded mode has you declare a placeholder body so you can control where on the page it appears, but the way the code actually behaves, the placeholder is ignored. I feel like there was probably an intention to check for and initialize unoRootElement to this placeholder if it existed, given the variable isn't initialized anywhere. I would imagine something like this first line was maybe intended and would fix the issue, but without knowing original intent, I don't know if this would potentially break something else that depends on the current behavior. var unoRootElement = document.getElementById('uno-body');// Suggested new line: check for and use optional placeholder uno-body if present
if(unoRootElement !== null) {
unoRootElement.innerHTML = html; // populate existing
} else { // no existing uno-body, create a new one in document root
var rootDiv = document.createElement(""div"");
rootDiv.innerHTML = html;
document.body.appendChild(rootDiv);
} Otherwise I just can't see how it'd ever fall into that first
|
When using embedded.js to load the package, it attempts to retrieve mono-config.js. The WASM package_ contains a mono-config.json but not a mono-config.js
When I inspect the embedded.js script throwing an error, it shows where it is attempting to generate a mono-config.js reference:
These are the script names declared further up in embedded.js that are the input to that reduce where they are all assumed to be *.js files:
I did a clean and rebuild and my WASM package contains the following:
The WASM project is .NET 7 and references Uno.Wasm.Bootstrap 7.0.27 and Uno.Foundation.Runtime.WebAssembly 4.9.45
I also created a fresh new .NET 7 console app in VS2022 17.7.0, copied the csproj definition per documentation with updated to 7.0.27 version, built to verify successful package generation, then added
<WasmShellMode>BrowserEmbedded</WasmShellMode>
to the csproj and cleaned then rebuilt. This package also did not contain a mono-config.js under bin/Debug/.net7.0/dist/ and I verified the emedded.js also includes the same script declaration that tries to load a mono.config.js. I have attached a zip of this project below. This is the csproj definition:WasmEmbeddedTest.zip
The text was updated successfully, but these errors were encountered: