PolymerElements / app-storage

Data-pipes and specialized services
61 stars 47 forks source link

Cannot read property 'baseURI' of undefined #105

Closed merlinnot closed 7 years ago

merlinnot commented 7 years ago

Description

Resolving BASE_URI in app-indexeddb-mirror/common-worker.js does not work in certain configurations. When webcomponents-loader.js does not load HTMLImports polyfill this condition is falsy indicating we're daling with Polymer 1.

Expected outcome

We should fix this condition.

Actual outcome

Reading property baseURI of undefined document._currentSript throws an error.

Steps to reproduce

  1. Put an app-indexeddb-mirror element in the page using Polymer 2 and web components loader.
  2. Open the page in Chrome 58.
  3. Observe errors in console.

Browsers Affected

timcsy commented 7 years ago

I have the same problem, too. (My browser is Chrome, and using Polymer 2) Uncaught ReferenceError: HTMLImports is not defined at common-worker.html:28 at common-worker.html:121 (anonymous) @ common-worker.html:28 (anonymous) @ common-worker.html:121

jdaroesti commented 7 years ago

I believe the changes in the commit fix currentScript baseURI 2ed5fb2ec31b74b2c29fbc0312e784372880c041 from march 8 caused the problem. I tested pointing my bower_components to b48e93147f4de60e3be09a49d9c63cff5e51e1cb (the commit before the afore mentioned changes) and the functionality returned on Chrome.

e111077 commented 7 years ago

Fixed in 9c5dfb3