PolymerElement class constructor cannot be called without a "new"

My application worked fine yesterday, but now when I do polymer serve -o, it opens the application and prints this error in the console.

Class constructor PolymerElement cannot be invoked without 'new'
+7
source share
5 answers
  • Delete cached files and images from the browser cache.
  • If you downloaded custom-elements-es5-adapter.js, delete it.
  • Then use $ polymer serve -compile never.

According to this post , this problem is the reason because $ polymer is used to compile your code on es5 automatically. The -compile option never stops the execution of $ polymer because of this.

+7

Polymer v.2.
:

, custom-elements-es5-adapter.js .

, ES6, ES5. ES5- ES5 ES6, HTMLElement.

+2

Polymer es5- Android- WebView. .

0

polymer.json custom-elements-es5-adapter excludes, ES5.

  "builds": [
    {
      "bundle": {
        "stripComments": true,
        "inlineCss": true,
        "sourcemaps": false,
        "excludes": [
          "bower_components/webcomponentsjs/webcomponents-loader.js",
          "bower_components/webcomponentsjs/custom-elements-es5-adapter.js"
        ]
      },
      "js": {
        "compile": true,
        "minify": true
      },
      "css": {
        "minify": true
      },
      "html": {
        "minify": true
      },
      "addServiceWorker": false
0

, , Parcel. , Custom Elements v1 ES6. Parcel ES5 - , Typescript tsconfig ES6.

, Parcel, , , ES5. - "browserlist" package.json.

I found out about this through this video . For more information, I suggest you look at this.

0
source

Source: https://habr.com/ru/post/1675258/


All Articles