0

my polymer.json

{
  "entrypoint": "index.html",
  "shell": "src/boo-blogger/boo-blogger.js",
  "sources": [
    "images/*",
    "fonts/*"
  ],
  "extraDependencies": [
    "manifest.json",
    "node_modules/@webcomponents/webcomponentsjs/*.js",
    "node_modules/web-animations-js/web-animations-next-lite.min.js",
    "node_modules/@webcomponents/webcomponentsjs/bundles/*.js"
  ],
  "builds": [
    {
      "name": "es6",
      "bundle": true,
      "browserCapabilities": [
        "es2015",
        "modules"
      ],
      "js": {
        "minify": true,
        "transformModulesToAmd": true
      },
      "html": {
        "minify": true
      },
      "css": {
        "minify": true
      },
      "addServiceWorker": true
    }
  ],
  "npm": true,
  "lint": {
    "rules": [
      "polymer-3"
    ]
  }
}

I got the problem

article-list.js:5 Uncaught (in promise) TypeError: _booBlogger.html$1 is not a function

article-list.js imported dynamic by routing. So I tried to attempt some build option differently to build. I found when I build without bundle, built code can work. I don't know why my code can not bundle by polymer build. if anyone is curious the problem and need completely source code. contact me

tools summary

  1. system: ubuntu 16.04
  2. polymer: 1.7.7
  3. node: 10.1.0

2 Answers2

0

In your polymer.json you need to add:

  "fragments": [
    "src/article-list.js"
  ],
Diego P
  • 1,728
  • 13
  • 28
0

I think you forgot to add article-list.js to your sources. As it is written in docs you have to include your dynamically imported modules to "sources" in polymer.json. See https://polymer-library.polymer-project.org/3.0/docs/apps/build-for-production#dynamic

Ilfatus
  • 31
  • 3