I am not able to get the my laravel app with with PHP8.1 in GCP Flex runtime working. I have tried and exhausted almost all possible solutions.
I think my issue is incorrect mime-type for js and css files.
These are my errors:
The stylesheet https://staging-dot-cryptotaxmate.uc.r.appspot.com/static/css/main.bcff62c9.chunk.css was not loaded because its MIME type, “text/html”, is not “text/css”
Could you please help me if you have any inputs?
This is my app.yaml:
Regards,
Vipin
Greetings @kpvipin,
Welcome to the Google Cloud Community!
It seems that the link you have given is actually an HTML file, not a CSS file, that is why you're getting that error. It is trying to apply the stylesheet but it cannot since it is not a CSS file.
What you can do here is make sure that the stylesheet you are referencing is actually a CSS file. You are misled into thinking that It's a CSS file because of its name, but in reality It's an HTML file.
If the above options don't work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!
Thanks for the reply. The file is actually a CSS file.
HI
I am also getting same issue in PHP 8.2 GAE(Flexible Environment).The same working in PHP 7.3. Can you tell me the solution .
HI,
Did u get any solution for this.I am also not able use php 8.2 Flexible GAE.
Hi,
Did u get any solution to include CSS and Js files in PHP 8 (GAE)
Hi Vipin,
Did u get any solution for php 8.2 Flexible Environment Deployment
HI vipin ,
Can you pls tell,your script working in php 8.2 (Flexible Environment).Mine is still not working.
Hi Staff,
I have been facing the same issue since I upgraded from PHP 7 to PHP 8.
We have tried a lot to change the "content-type" but unable to change its on google cloud even its correct in the code.
The content type is "text/css" and "text/javascript" for CSS and JS files while on the console it's changed to text/html once the upload is on Google Cloud.
Staff: what may cause the issue?
From where I should have to change the "content-type" to react correctly on Google Cloud?
Thanks