表題の環境で、モバイルから写真をStorageにアップするとStorageから下記のエラーが返される。
Client uploaded to the wrong offset (262144 instead of 0)
これを解消するには、ngsw-worker.js
の、onFetch(event)
に下記を追加する。
if (event.request.url.indexOf('firebasestorage.googleapis.com') !== -1) { return; }
つまり、こんな感じになる
/**
* The handler for fetch events.
*
* This is the transition point between the synchronous event handler and the
* asynchronous execution that eventually resolves for respondWith() and waitUntil().
*/
onFetch(event) {
if (event.request.url.indexOf('firebasestorage.googleapis.com') !== -1) { return; }
これで、Storageにアップできるようになった。