2

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.

Homa
  • 3,417
  • 2
  • 19
  • 24
  • I can't reproduce this with Polymer Starter Kit 2. Can you provide repro steps? Or a sample repo to reproduce the problem? – tony19 Jun 05 '17 at 16:26
  • @tony19 I put a sample here: https://github.com/Homa/polyer2-test – Homa Jun 05 '17 at 17:39
  • Hmm. Still cannot reproduce. I'm on macOS Sierra, node 7.10.0, polymer-cli 1.1.0. – tony19 Jun 05 '17 at 18:11
  • I recommend [re]running `npm install` or `yarn` to install your dependencies. – tony19 Jun 06 '17 at 01:07
  • @tony19: I was using polymer-cli locally. After installing latest polymer-cli globally, now I get “Constructor requires ‘new’ operator” in safari and “Failed to construct ‘HTMLElement’: Please use the ‘new’ operator, this DOM object constructor cannot be called as a function.” in chrome. – Homa Jun 06 '17 at 12:22

1 Answers1

2

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.

codeMonkey
  • 4,134
  • 2
  • 31
  • 50
  • currently trying something similar. May i message you for help? – Flowlicious Jul 27 '17 at 10:15
  • @EffGee I am by no means an expert, but if you join the Polymer slack channel at [polymer.slack.com](http://polymer.slack.com), the Polymer engineers are actually in the general channel and will answer questions! That's where I usually go :) – codeMonkey Jul 28 '17 at 03:23