tools: polymer-build breaks the app-storage/app-indexeddb-mirror element

Description

polymer-build breaks the app-storage/app-indexeddb-mirror element.

Versions & Environment

  • polymer-build: v0.13.0
  • node: v6.3.0
  • Operating System: OS X

Steps to Reproduce

git clone https://github.com/GDGSpain/gdg.es.git

npm install && bower install

gulp polymer-build

polymer serve build/bundled

Open the localhost:8080/groups page.

Expected Results

screen shot 2016-08-05 at 00 32 33

Achieved with the polymer serve.

Actual Results

screen shot 2016-08-05 at 00 31 23

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 33 (24 by maintainers)

Most upvoted comments

I got this problem because of my service worker. I’m pretty sure you also have one and it also is the cause for you. I solved this problem by adding this to sw-precache-config.js:

ignoreUrlParametersMatching: [/^<your origin here>/]

So for example for @abdonrd it would be:

ignoreUrlParametersMatching: [/^https:\/\/gdg-es-develop\.firebaseapp\.com/]

Of course, as you already found out, it’s also required to add this to polymer.json:

"extraDependencies": [
  "bower_components/app-storage/app-indexeddb-mirror/app-indexeddb-mirror-worker.js",
  "bower_components/app-storage/app-indexeddb-mirror/common-worker-scope.js"
]

Explanation

As it’s written here

sw-precache finds matching cache entries by doing a comparison with the full request URL

So https://gdg-es-develop.firebaseapp.com/bower_components/app-storage/app-indexeddb-mirror/common-worker-scope.js?https://gdg-es-develop.firebaseapp.com/bower_components/app-storage/app-indexeddb-mirror/app-indexeddb-mirror-worker.js because of this crazy parameter it couln’t find this URL among the precached and so it returned 404.

For me it should be at least noted in the app-storage documentation like it’s noted about extraDependencies link

Or it should be redesigned to avoid problems like this at all.

@kownacki your solution works for me! Thanks a lot!

@abdonrd It is enough to make it working in desktop browsers where Shared Workers are available. But app-storage on android switches to Web Workers which causes more problems which can be solved with ignoreUrlParametersMatching.

I hope it helps 😃

@abdonrd @FredKSchott @midesweb This is how I resolve this issue - to include the .js files inside app-storage/app-indexeddb-mirror for both bundled and unbundled.

  "sourceGlobs": [
   "src/**/*",
   "images/**/*",
   "bower.json",
   "bower_components/app-storage/app-indexeddb-mirror/*.js"
  ],

You are seeing that output on my #34 branch? Hmm… That’s strange because that’s exactly what that branch is supposed to fix.

Will take a look first thing tomorrow morning On Tue, Nov 1, 2016 at 6:21 PM Abdón Rodríguez Davila < notifications@github.com> wrote:

Right now, the behaviors (with your GDGSpain/gdg.es#34 https://github.com/GDGSpain/gdg.es/pull/34) break the build:

[image: screen shot 2016-11-02 at 02 20 31] https://cloud.githubusercontent.com/assets/1007051/19913451/fe5df6b8-a0a2-11e6-9f9e-0f636feadfa1.png

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Polymer/polymer-build/issues/22#issuecomment-257746627, or mute the thread https://github.com/notifications/unsubscribe-auth/AAl-kxK6aX8NzGEfMQ8vQGoKDnHAU2keks5q5-WAgaJpZM4Jd4vu .

Otherwise, please update your steps to reproduce (currently getting Error: File not found with singular glob: /Users/fschott/Code/gdges/app.yaml) and I’ll take a look.

@abdonrd the new analyzer was added in v0.5.0, can you download the latest version from npm and see if that fixes it? Fingers crossed for you…

@abdonrd sorry I still haven’t been fix the problem you’re seeing with that element. I’ll try to find some time next week but I can’t promise I’ll be able get to it 😦

Have you tried digging into the build command yourself? Try using the --verbose flag & maybe adding some logging of your own, you might be able to spot something that I missed when I first looked into this.