在Firebase托管中部署网站时,出现有线错误。 当我在本地运行该网站时,效果很好,但是当我使用Firebase托管时,它显示了一个错误
Uncaught SyntaxError: Unexpected token <
在每个单个javascript文件的第一行 这是我的索引文件
<html>
<head>
<meta charset="UTF-8">
<script language="javascript" type="text/javascript" src="libraries/p5.js"></script>
<script language="javascript" src="libraries/p5.dom.js"></script>
<script language="javascript" src="libraries/p5.sound.js"></script>
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<script language="javascript" type="text/javascript" src="player.js"></script>
<script language="javascript" type="text/javascript" src="Pipe.js"></script>
<script language="javascript" type="text/javascript" src="PipePair.js"></script>
<script language="javascript" type="text/javascript" src="Ground.js"></script>
<script language="javascript" type="text/javascript" src="ConnectionGene.js"></script>
<script language="javascript" type="text/javascript" src="ConnectionHistory.js"></script>
<script language="javascript" type="text/javascript" src="Node.js"></script>
<script language="javascript" type="text/javascript" src="Population.js"></script>
<script language="javascript" type="text/javascript" src="Species.js"></script>
<script language="javascript" type="text/javascript" src="Genome.js"></script>
</head>
<body>
<script src="/__/firebase/6.0.2/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#reserved-urls -->
<!-- Initialize Firebase -->
<script src="/__/firebase/init.js"></script>
</body>
</html>
该站点无法识别所有javascript文件,但可以识别索引html文件,并且它们位于同一文件夹中
这是一个javascript文件
//a connection between 2 nodes
class connectionGene {
constructor(from, to, w, inno) {
this.fromNode = from;
this.toNode = to;
this.weight = w;
this.enabled = true;
this.innovationNo = inno; //each connection is given a innovation number to compare genomes
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//changes the this.weight
mutateWeight() {
var rand2 = random(1);
if (rand2 < 0.1) { //10% of the time completely change the this.weight
this.weight = random(-1, 1);
} else { //otherwise slightly change it
this.weight += (randomGaussian() / 50);
//keep this.weight between bounds
if (this.weight > 1) {
this.weight = 1;
}
if (this.weight < -1) {
this.weight = -1;
}
}
}
//----------------------------------------------------------------------------------------------------------
//returns a copy of this connectionGene
clone(from, to) {
var clone = new connectionGene(from, to, this.weight, this.innovationNo);
clone.enabled = this.enabled;
return clone;
}
}
问题出在哪里?