-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ios Local device component css failing to load #5245
Comments
Probably has something to do with Hot Restart. Are you maybe able to verify it does work on a Mac? It would also really help if you could attach a small reproduction project that shows this issue, thanks! |
It should be reproducible here: https://github.com/CodeBoop/MauiApp2 I can't test it on a Mac at the moment as I don't have access to one currently. |
Correction! Not true, this also happens on a Mac on a Simulator |
Sorry yeh, it's just a new project, nothings been added. |
Could you check if you have the latest templates? When I create a new project with the latest templates this works fine. Go to a command-window and do: |
I get the following:
|
Looks like it installed something then. Could you try again with these new templates? |
It's producing the same errors. However, there does appear to be a Hot Reload issue that I'd missed originally.
|
I am not sure if this is applicable to this bug but I found the asset path "app://0.0.0.0" did not reliably work when loading css from assets. Instead I changed my code to use Foundation.NSBundle.MainBundle.ResourcePath. See bellow for my code that takes HTML and applies a local asset css style.
|
@owaits is that just rewriting the urls in the header section of the index.html? |
I bind the WebView BaseUrl to the BaseUrl property in HtmlEntryAdapter. This ensures that any urls within the webview point to the bundle resource path. So in the xaml bellow the binding context is an instance of HtmlEntryAdaptor.
|
have you got a link to an example, as I can't see where that exists/would go inside the Blazor examples? |
@jfversluis - I can now confirm that it does work when paired with a mac. |
Possible dupe? #4061 |
@codeboop The app that you provided a link to doesn't contain any scoped CSS within the shared library. What happens if you remove this line. My hunch is that the local device might be more eager about loading CSS files that weren't actually generated. Inversely, what happens when you include the scoped CSS files back? |
@codeboop - I was looking at this with @captainsafia and I suspect that the various CSS files in the app got deleted somehow. The project is supposed to have the CSS files seen in this folder:
So you could try copying those files into your app, which I think might be the right solution here. Can you confirm if that works for you? And also if you have some idea how those files got removed? |
Description
When running the app through a local device - not paired with a mac - the app fails to load the isolated css and any 3rd party library styles. It will load files in the webroot/css.
Safari seems to be complaining about a MIME type issue, but that may be related to a lack of content.
Steps to Reproduce
Create new "blank" (weather app) Maui Blazor app
Debug on iOS - Local Device as target
Version with bug
Preview 13 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15.3.1
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: