Your file type is js, and ends in .js
Somewhere you need to output a .html file, even if all it does is load the .js file.
In firebase i thin you can add a config file to declare redirects, ie i’m a single page app, always serve index.html
-_- g’luck
the type was changed to “text/html”
firebase config setting “public” was changed to build serving the react-app project correctly
Deploying our react-app to firebase these past few days have shown us some unexpected errors. We have a script in the index.html file that is throwing this error.
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>THE RISE COLLECTION | Software Development</title>
<meta charset="utf-8">
<meta name="author" content="jiosh_">
<meta name="description" content="THE RISE COLLECTION | Innovating Without Forgetting To Be Creative">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="shortcut icon" href="assets/images/favicon.png">
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
<link href="/static/css/main.05c6e305.css" rel="stylesheet">
</head>
<body class="landing-page" data-spy="scroll" data-target=".navbar" data-offset="75">
<div class="loader-wrapper"><div class="loader">
</div>
</div>
<div id="root">
</div>
<script src="assets/js/jquery-3.3.1.min.js">
</script>
<script src="assets/js/bootstrap.min.js">
</script>
<script src="assets/js/land-scripts.js">
</script>
<div id="color">
</div>
<script src="assets/js/script.js">
</script>
<script src="assets/js/scroll.js">
</script>
<script type="text/javascript" src="/static/js/main.5533582a.js">
</script>
</body>
</html>
what the script shows in the google chrome console :
<html lang="en"> <- error coming from this line
<head>
<title>THE RISE COLLECTION | Software Development</title>
<meta charset="utf-8">
<meta name="author" content="jiosh_">
<meta name="description" content="THE RISE COLLECTION | Innovating Without Forgetting To Be Creative">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="shortcut icon" href="assets/images/favicon.png">
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
<link href="/static/css/main.05c6e305.css" rel="stylesheet">
</head>
<body class="landing-page" data-spy="scroll" data-target=".navbar" data-offset="75">
<div class="loader-wrapper"><div class="loader">
</div>
</div>
<div id="root">
</div>
<script src="assets/js/jquery-3.3.1.min.js">
</script>
<script src="assets/js/bootstrap.min.js">
</script>
<script src="assets/js/land-scripts.js">
</script>
<div id="color">
</div>
<script src="assets/js/script.js">
</script>
<script src="assets/js/scroll.js">
</script>
<script type="text/javascript" src="/static/js/main.5533582a.js">
</script>
</body>
</html>
I have gone through quite a few questions and have yet to find a solution that works. This project is a react-app.
Note
I have tried removing/readding “text/javascript” along with changing the src tag to just the file name.
That sounds like an HTML page (probably a custom error page) being returned to something that was probably expecting JSON. Have you inspected the network tab in your browser’s developer tools?
@TiesonT.
just figured it out seconds ago… type was changed to “text/html” and the public param in the firebase config wase changed to build and the project is now live.