Did not parse stylesheet at 'ionic://localhost/styles.css' because non CSS MIME types are not allowed in strict mode

I’m working on a cross-platform mobile app and using ionic and angular frameworks. My app is running fine on iOS simulators and devices. recently I bought a new Macbook Air with M1 Chip. When I tried running the app on M1 MacBook I’m getting the below error.

Did not parse stylesheet at 'ionic://localhost/styles.css' because non CSS MIME types are not allowed in strict mode.

When I tried to navigate to the CSS file in web inspector it is showing “An error occurred trying to load the resource”. I’m new to web technologies, so not sure how to fix it. I really appreciate any help. Thank you.


Can you provide a sample or steps to reproduce this?

Hi, thanks for your reply.

I’m using ionic cordova build ios to run the app on the simulator, and there are no errors while building. But when the app was launched on the simulator, it was not loading correctly. This issue is happening on Macbook Air with M1 Chip, but when I run the same app simulator on Macbook Pro with Intel chip, the app is running as expected.

Can you please provide a sample app in the form of a github repo? We can try to run that on an M1 mac, but I don’t believe there are any knonw issues around this.

Your problem has been solved??

It’s a known M1 bug, check this workaround

Thank you @jcesarmobile for pointing me towards the solution. Unfortunately, the above workaround didn’t work for me, but using the modified plugin cordova-plugin-ionic-webview by qrdp worked for me.