polymer-cli - getting “Can’t find variable: babelHelpers” when I set compile to true

廉价感情. 提交于 2020-01-04 13:10:34

问题


I use Polymer 2.0 and my build setting is:

"builds": [
{
  "name": "bundled",
  "bundle": true,
  "js": { "compile": true},
  "css": { "minify": true },
  "html": { "minify": true }
}]

I get "Can’t find variable: babelHelpers" error after build.

The Polymer CLI version that I use is 1.1.0.

EDIT: I was using polymer-cli locally. After installing latest polymer-cli globally, now I get “Constructor requires ‘new’ operator” on safari and “Failed to construct ‘HTMLElement’: Please use the ‘new’ operator, this DOM object constructor cannot be called as a function.” on chrome.

EDIT2: used webcomponents-loader.js instead of webcomponents-lite.js and my problem solved.


回答1:


I was getting same error. Problem was that index.html is technically my entrypoint in my polymer.json config, but my actual served up entrypoint is another file that comes from my server (_Layout.cshtml since I'm using .NET on my backend). What I needed to do was take the code in my compiled index.html file and move it over to my CSHTML file once I set "compile": true. Problem solved.



来源:https://stackoverflow.com/questions/44373210/polymer-cli-getting-can-t-find-variable-babelhelpers-when-i-set-compile-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!