-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bug: MIME Types ignored/blocked in strict mode #5793
Comments
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue. Please see the Contributing Guide for how to create a Code Reproduction. Thanks! |
Issue can be reproduced using the standard capacitor test app at: Environment: Steps to reproduce: From MacOS running on M1 or M1 Pro, clone repo:
Console gives following output: [Error] Did not parse stylesheet at 'capacitor://localhost/static/css/7.532f36fa.chunk.css' because non CSS MIME types are not allowed in strict mode. |
Inspecting the Network requests for these files shows they were served with MIME Type "application/octet-stream": Summary Request Response |
+1 just got an M1 Mac and now facing this issue with all of my projects. Not running Xcode in Rosetta either. |
@jcesarmobile Have you guys been able to look into this? Even after updating Capacitor to the latest version (4.0.1), CSS files still aren't loading as expected |
I know this repo is for Capacitor, but I can confirm this occurs in Cordova as well. I was able to get around this issue (temporarily) by adding this code to if ([fileExtension isEqualToString:@"css"]) {
return @"text/css";
} I have only seen this when running in Rosetta, but I can't run on the M1 chip directly because of some of the plugins I am using. So I have not been able to confirm myself if this is Rosetta-only. |
…5853) * Fixed issue ionic-team#5793 * add TODO * fmt * Disable type_body_length rule Accommodating the big MIME list Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: giralte-ionic <97970732+giralte-ionic@users.noreply.github.com>
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
Platform(s)
iOS (14.0+)
Current Behavior
XCode / iOS Simulator is not loading local stylesheets when running on brand new MacBook with M1 Pro - page loads but local CSS files do not load. Safari Inspector shows error messages related to the MIME types of the specified stylesheets, even when
type="text/css"
is specified in the tags. XCode is NOT running in Rosetta mode as suggested in previous bug reports.Safari Error Message:
"Did not parse stylesheet at 'capacitor://{app_name}/{file_name}.css' because non CSS MIME types are not allowed in strict mode."
Expected Behavior
Specified stylesheets should load without error and be applied properly.
The text was updated successfully, but these errors were encountered: