【问题标题】:meteor packages error "Resource interpreted as Image but transferred with MIME type text/html"流星包错误“资源解释为图像但使用 MIME 类型文本/html 传输”
【发布时间】:2014-12-25 23:16:29
【问题描述】:

在我的 Meteor 项目中,我包含了一些传单包(fuatsengul:leaflet、bdunnette:leaflet-draw)。地图绘制正常,但我缺少图层控件和绘制命令按钮的所有图标。 浏览器控制台说:

Resource interpreted as Image but transferred with MIME type text/html:
"http://localhost:3000/packages/fuatsengul_leaflet/lib/images/layers.png".

我应该手动将一些 png 复制到我的 /public 文件夹还是应该由打包/构建系统来完成?

【问题讨论】:

    标签: meteor leaflet


    【解决方案1】:

    Meteor 不太适合 404。这意味着该 URL 正在提供一个 html 文件(Meteor 的 html 文件),即使它需要一个 png 文件。

    这就是 Meteor 的行为方式,而不是炮击 404。

    要修复它,您必须修改包以使图像文件成为资产,或者将其放在您的公共文件夹中,以便映射到 /packages/fuatsengul_leaflet/lib/images/layers.png

    最好的办法是修改 package.js 并添加所有资源并向 repo 提交 PR,因为这听起来像是包中的错误。

    【讨论】:

      猜你喜欢
      • 2014-11-01
      • 2011-12-24
      • 2014-05-20
      • 2012-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-14
      相关资源
      最近更新 更多