【问题标题】:Uncaught (in promise) TypeError: object is not a constructor(…) in ionic2Uncaught (in promise) TypeError: object is not a constructor(...) in ionic2
【发布时间】:2016-10-28 13:24:55
【问题描述】:

虽然使用 ionic2 运行基本应用程序,但它也会给出如下错误:Uncaught (in promise) TypeError: object is not a constructor(...) in ionic2.


创建新应用:ionic start appname tutorial --v2

正在运行的应用程序:离子服务

我的系统规格:

Ubuntu:14.04(64 位)

Chrome:版本 49.0.2623.87(64 位)

节点:v5.6.0

npm : v3.6.0

【问题讨论】:

  • 这不是 ionic2 问题,而是 es6-shim 问题 :)

标签: ionic2 es6-shim


【解决方案1】:

请参阅here。它以特定的 Chrome Canary 版本显示,这似乎是由于 es6-shim。据报道,它已在es6-shim v0.34 中修复。或者您可以切换到 core-js shim,如 here 所述。

但如果你使用的库(比如 Ionic)依赖于特定的 es6-shim 版本,我想你会等待库更新。

【讨论】:

  • 顺便说一句,下次用(部分)错误消息抛出谷歌搜索,看看会出现什么。
  • 很高兴在答案中看到我的回购作为解决方案:)
  • 致反对者:请允许我理解答案有什么问题。助教
  • @superjos 我已经升级到shim 0.35,但我仍然看到错误,请你帮我解决这个问题.. 我的项目在github.com/globalquran/mobile-app
  • 为了安全起见,您是否尝试过删除node_modules下的es6-shim目录,然后再次运行npm install
猜你喜欢
  • 1970-01-01
  • 2020-03-25
  • 2017-04-13
  • 2020-03-17
  • 2020-01-06
  • 2021-03-10
  • 2021-09-30
  • 2020-12-22
  • 2019-06-15
相关资源
最近更新 更多