amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

strict MIME type errors, page does not load on certain sites #98

Closed crankedguy closed 10 months ago

crankedguy commented 10 months ago

Hi,

I cannot get this to run on one site of mine, while it runs fine on others. I rebuilt it with local .js files because of data protection measures in the country. As said it works fine on e.g. a WP site. Here on this site I get opcm.php:1 Refused to execute script from 'https://domain.com/opcm/react.production.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. I get this for all 3 .js scripts

Basically in the inspector I get

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0">
        <title>OPcache statistics on domain.com</title>
        <script src="react.production.min.js"></script>
        <script src="react-dom.production.min.js"></script>
        <script src="axios.min.js"></script>

with a red cross on the first line saying this is a html document and so throwing the MIME errors.

I also did the following

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0">
        <title>OPcache statistics on domain.com</title>
        <script type="text/javascript" src="react.production.min.js"></script>
        <script type="text/javascript" src="react-dom.production.min.js"></script>
        <script type="text/javascript" src="axios.min.js"></script>

but it leads to the same result

Any idea what to do or how to change the code here?

crankedguy commented 10 months ago

Well, when it comes to such situations I usually freak out completely as I don't know what;'s going on : Just to try it out I completely inlined the code in the head section on the page where it not worked. After that it was working without any issues. Guess what. Without doing anything on the other side I called it there, where it was not inlined, and suddenly I got the same MIME issues and it was not working on this page anymore. Did not get it back to work until I inlined the code there, too. I hate "magical" things on my own server, as I was sure it something to do with .htaccess from the page where it was not working. But that can;t be the case anymore because why is it not working on the page it worked before.

Whatever... for future releases : Would it be too hard for you to inline the code when automatically when building with -j?

EDIT : I inlined them in the section like this

Githubissues.
  • Githubissues is a development platform for aggregating issues.