app-storage icon indicating copy to clipboard operation
app-storage copied to clipboard

common-worker.html#L23 uses incorrect BASE_URI breaks indexeddb SW on Firebase

Open n1ywb opened this issue 9 years ago • 2 comments

Description

common-worker-scope.js fails to load with 404 when using polymer cli starter kit and firebase hosting because BASE_URI at https://github.com/PolymerElements/app-storage/blob/master/app-indexeddb-mirror/common-worker.html#L23 is wrong

see also:

  • https://github.com/notwaldorf/mojibrag/issues/49
  • https://github.com/Polymer/polymer-build/issues/22

Expected outcome

URI should be https://mojibrag.firebaseapp.com/bower_components/app-storage/app-indexeddb-mirror/common-worker-scope.js

Actual outcome

URI generated is

https://mojibrag.firebaseapp.com/src/common-worker-scope.js

service worker fails to load

Live Demo

https://mojibrag.firebaseapp.com

Steps to reproduce

  1. open https://mojibrag.firebaseapp.com on android device
  2. Start chrome remote debugging
  3. reload page
  4. note service worker fails to load

I was able to work around this issue by hacking the currect BASE_URI into common-worker.html but I don't think this is the correct solution

var BASE_URI = "/bower_components/app-storage/app-indexeddb-mirror";

Browsers Affected

  • [X ] Chrome Android

n1ywb avatar Nov 30 '16 12:11 n1ywb

I think this is related to https://github.com/Polymer/polymer-build/issues/22 and https://github.com/notwaldorf/mojibrag/issues/49

n1ywb avatar Nov 30 '16 16:11 n1ywb

I kludgily hacked around this in https://github.com/PolymerElements/app-storage/blob/master/app-indexeddb-mirror/common-worker.html#L23

var BASE_URI = "";
var WORKER_SCOPE_URL =
    Polymer.ResolveUrl.resolveUrl('/bower_components/app-storage/app-indexeddb-mirror/common-worker-scope.js', BASE_URI);

n1ywb avatar Nov 30 '16 16:11 n1ywb