没有'new'就不能调用类构造函数PolymerElement [英] Class constructor PolymerElement cannot be invoked without 'new'

查看:80
本文介绍了没有'new'就不能调用类构造函数PolymerElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我的应用程序工作正常,但是当我现在聚合物服务-o 时,它会打开应用程序并在控制台中输出此错误。

Yesterday my app worked perfectly however when I now do polymer serve -o it opens the app and prints this error in the console.

Class constructor PolymerElement cannot be invoked without 'new'


推荐答案


  1. 清除浏览器缓存中的缓存文件和图像。

  2. 如果你加载 custom-elements-es5-adapter.js ,将其删除。

  3. 然后使用 $ polymer serve --compile never

  1. Clear the Cached files and images from your browser cache.
  2. If you loaded custom-elements-es5-adapter.js, remove it.
  3. Then use $ polymer serve --compile never.

根据这篇文章,这个问题是因为 $ polymer serve 自动将你的代码编译成es5。 - compile never 标志阻止 $ polymer serve 执行此操作。

According to this post, this issue is cause because $ polymer serve compiles your code to es5 automatically. The --compile never flag stops $ polymer serve from doing this.

这篇关于没有'new'就不能调用类构造函数PolymerElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆