【问题标题】:Meteor - IE11 displays a blank pageMeteor - IE11 显示空白页
【发布时间】:2018-03-31 18:59:20
【问题描述】:

我在 IE11 下得到这个错误:

object 不支持在线“for”这个属性或方法:

var esSymKey = useSymbol ? Symbol.for(esStrKey) : null; 

来自 node_modules/meteor/modules/node_modules/reify/lib/runtime/utils.js
在 modules.js 中。

我尝试更新所有内容,但没有成功

我的包列表如下:

meteor-base

mobile-experience
mongo
blaze-html-templates 
session     
jquery@1.11.10  
tracker
es5-shim

coffeescript
msavin:mongol
tap:i18n
tap:i18n-db-modified
globalconstants
reywood:publish-composite
fourseven:scss
reactive-var
mystor:device-detection
subs-manager-modified
fastclick
check
manuelschoebel:ms-seo-modified
mrt:modernizr-meteor
gorillastack:iron-router-gtm
iron:router
standard-minifier-css
standard-minifier-js
add-scripts
tap:i18n-bundler
shell-server
dynamic-import
webapp

chrome-spiderable

你有什么想法吗?

谢谢。

【问题讨论】:

  • 你是怎么解决的?
  • 我在 head.html 中添加了
  • 非常感谢!它对我有用
  • 我曾经收到此错误,因为我将 YouTube Embed API 嵌入到我的应用程序的 /client/header.html 文件中。在/startup/client/cdn_scripts.js 中使用$.getScript 加载它,它修复了空白页问题。原来加载的脚本在 IE11 中有一个错误,它以第一种方式加载它,使整个应用程序黑屏。

标签: javascript meteor internet-explorer-11 reify


【解决方案1】:

IE 11 不支持Symbol

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

你需要添加一个 polyfill 来增加对它的支持。

https://github.com/medikoo/es6-symbol

如果您使用其他 es6+ 功能,您可能会在填充 Symbol 后立即遇到另一个错误。您可能应该使用某种转译器,例如Babel。它将确保您的新代码在旧浏览器上运行。

【讨论】:

  • 这当然是问题所在。我安装了 babel-polyfill 并在 main.js 的顶部执行了 require('babel-polyfill') ,但遇到了同样的问题。这个特定的错误出现在 Meteor Reify 核心中:node_modules/meteor/modules/node_modules/reify/lib/runtime/utils.js 在发生这种情况之前我无法加载 polyfill。
  • 更新:我看到上面的技巧在标题中执行
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-03
  • 2021-01-10
  • 2014-07-19
  • 2015-06-06
  • 2020-07-03
  • 1970-01-01
相关资源
最近更新 更多