jeudi 19 novembre 2020

Ember The Resource from 'path' was blocked due to MIME type error with blank screen

I'm working on an Ember application with a .NET backend. In building the ember app, it complies into the proper directory. My directory structure looks like below:

myProjectRoot
   |
   |-> NETProject
   |       |
   |        -> Compiled-Ember 
   |
    -> Ember project

I currently have it running as an IIS application pointing to NETProject, though if I run via ember serve I get the same results. All the IIS config is proper and works. The issue is trying to load the page I get the following errors, one for each vender.css, vendor.js, projectName.js, and projectName.css:

The resource from “http://localhost/404.aspx?404origin=%2fcompiled-ember%2fassets%2fprojectName.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

The title and favicon load, but the rest of the page is blank. It should be noted that the app will redirect to a 404 page upon not finding the requested URL.

Now the resources do exist where they are supposed to, the project builds without issue and all compiled files exist in compiled-ember. Now I have seen that this is a common issue with the path, I have messed with the path in the compiled index.html file (which is where it sources from as changing the path here changes the error to match). I've gotten no other results, than the error above. Here is the index.html file

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>ProjectName</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="icon" type="image/x-icon" href="https://hostedimagelocation.com">
    <base href="/" />

    
<meta name="projectName/config/environment" />
    <link integrity="" rel="stylesheet" href="/compiled-ember/assets/projectName.css">

    
</head>
<body>


<script src="/compiled-ember/assets/vendor.js"></script>
<script src="/compiled-ember/assets/projectName.js"></script>


</body>
</html>

The index.html file is located directly in compiled-ember. I have tried switching the paths to be like assets/vendor.js and others to no avail. Any help to solving this error would be very helpful. Thank you




Aucun commentaire:

Enregistrer un commentaire