第一次连接提供了不受支持的MIME类型,但在浏览器刷新后工作正常吗



在应用程序引擎上部署应用程序后,首先连接Chrome客户端会抛出以下错误。

"Refused to apply style from 'https://tournypoker.wl.r.appspot.com/styles/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."

经过几次浏览器刷新后,错误消失了,一切似乎都很好。我试着在类似的问题上关注其他一些线索,但没有成功。

这里有一些代码显示了如何在index.jade中加载样式表--

html(lang="en"ng app="app"(

head
title Poker
link(href="styles/styles.css" rel="stylesheet" type="text/css")
body
#content(ng-view)
script(type="text/javascript", src="socket.io/socket.io.js")
script(type="text/javascript", src="js/libs/angular.min.js")
script(type="text/javascript", src="js/libs/angular-route.min.js")
script(type="text/javascript", src="js/app.js")
script(type="text/javascript", src="js/controllers/lobby.js")
script(type="text/javascript", src="js/controllers/table.js")
script(type="text/javascript", src="js/controllers/chat.js")
script(type="text/javascript", src="js/services/sounds.js")
script(type="text/javascript", src="js/directives/seat.js")

发现GCP应用程序引擎标准环境不支持websocket。这个应用程序试图建立websocket,其副作用如上所述。我更改了我的app.yaml以使用应用引擎flex环境——这修复了这个问题以及websocket问题。

[START gae_quickstart_yaml]

运行时:nodejsenv:flex

网络:session_afinity:真正的

手动缩放(_S(:实例:1资源:cpu:1memory_gb:0.5disk_size_gb:10

[结束gae_quickstart_yaml]

最新更新