Chrome 生产环境中的 devtools 错误
Chrome devtools errors in production
我的 rails
应用程序由 heroku
部署时出现两个错误。站点:https://powerful-atoll-73299.herokuapp.com/。 第一个错误如下:
Mixed Content: The page at 'https://powerful-atoll-73299.herokuapp.com/' was loaded over HTTPS, but requested an insecure image 'http://www.zastavki.com/pictures/1366x768/2008/Drawn_wallpapers_Family_tree_007294_.jpg'. This content should also be served over HTTPS.
我理解这个错误,因为它非常简单明了。所以我决定做的是将图像保存到我的本地机器上,然后将其放入我的项目中。所以它不再试图提取它的不安全 link 地址。所以现在我将图像称为:background: url("/family-tree.jpg") no-repeat center center scroll;
。这有效并且没有潜在问题。但是,当我从具有更新更改的主分支推送到 heroku
时,会发生什么...... heroku
版本仍然保留图像的不安全地址 link。当我检查该项目时,您甚至可以看到它使用 http://www.zastavki.com/pictures/1366x768/2008/Drawn_wallpapers_Family_tree_007294_.jpg
而不是 /family-tree.jpg
。当我用照片位置替换地址时,图片仍然显示,但错误仍然存在。知道为什么会这样吗?为什么我把实际本地拷贝上推的时候heroku
有图片地址link?
第二个错误如下:
'//@ sourceURL' and '//@ sourceMappingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead. codeschool devtools.js:1
我明白这个错误是找我把@
换成#
。我不确定在哪里或如何执行此操作。任何建议将不胜感激。同样,所有这些错误目前都出现在生产中,而不是开发中。
您可能遇到的可能问题,资产在部署后未加载。也许重新启动可以解决问题 heroku restart
编辑
我查看了您的 css 代码,您似乎仍然在 css 文件中将 url 设置为 signup-section
class 的背景.
参考:
.signup-section {
width: 100%;
padding: 50px 0;
color: #fff;
background: url(http://www.zastavki.com/pictures/1366x768/2008/Drawn_wallpapers_Family_tree_007294_.jpg) no-repeat center center scroll;
background-color: #000;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover
}
更新它并进行部署,你应该可以开始了。
我的 rails
应用程序由 heroku
部署时出现两个错误。站点:https://powerful-atoll-73299.herokuapp.com/。 第一个错误如下:
Mixed Content: The page at 'https://powerful-atoll-73299.herokuapp.com/' was loaded over HTTPS, but requested an insecure image 'http://www.zastavki.com/pictures/1366x768/2008/Drawn_wallpapers_Family_tree_007294_.jpg'. This content should also be served over HTTPS.
我理解这个错误,因为它非常简单明了。所以我决定做的是将图像保存到我的本地机器上,然后将其放入我的项目中。所以它不再试图提取它的不安全 link 地址。所以现在我将图像称为:background: url("/family-tree.jpg") no-repeat center center scroll;
。这有效并且没有潜在问题。但是,当我从具有更新更改的主分支推送到 heroku
时,会发生什么...... heroku
版本仍然保留图像的不安全地址 link。当我检查该项目时,您甚至可以看到它使用 http://www.zastavki.com/pictures/1366x768/2008/Drawn_wallpapers_Family_tree_007294_.jpg
而不是 /family-tree.jpg
。当我用照片位置替换地址时,图片仍然显示,但错误仍然存在。知道为什么会这样吗?为什么我把实际本地拷贝上推的时候heroku
有图片地址link?
第二个错误如下:
'//@ sourceURL' and '//@ sourceMappingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead. codeschool devtools.js:1
我明白这个错误是找我把@
换成#
。我不确定在哪里或如何执行此操作。任何建议将不胜感激。同样,所有这些错误目前都出现在生产中,而不是开发中。
您可能遇到的可能问题,资产在部署后未加载。也许重新启动可以解决问题 heroku restart
编辑
我查看了您的 css 代码,您似乎仍然在 css 文件中将 url 设置为 signup-section
class 的背景.
参考:
.signup-section {
width: 100%;
padding: 50px 0;
color: #fff;
background: url(http://www.zastavki.com/pictures/1366x768/2008/Drawn_wallpapers_Family_tree_007294_.jpg) no-repeat center center scroll;
background-color: #000;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover
}
更新它并进行部署,你应该可以开始了。