ionic-team / ionic-pwa-toolkit

Build lightning fast Progressive Web Apps with zero config and best practices built-in. Go from zero to production ready with Ionic and Stencil (Web Components).
MIT License
635 stars 74 forks source link

ServiceWorker error when deploying production build to firebase #72

Closed yannickvg closed 6 years ago

yannickvg commented 6 years ago

Resources: Before submitting an issue, please consult our docs.

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

    "@stencil/core": "^0.9.11"

I'm submitting a ... (check one with "x") [x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

I'm using stencil in combination with "@ionic/core": "4.0.0-alpha.7". When deploying a production build to firebase, some service worker errors are visible.

Expected behavior: The service worker should be registered in the browser.

Steps to reproduce:

I created a little test app to reproduce this problem: https://github.com/yannickvg/ionic-virtualscroll Running this app in dev mode works fine. If you run a production build and deploy that to firebase, it will show the following errors.

/workbox-v3.2.0/workbox-sw.js:1 Uncaught SyntaxError: Unexpected token <
    at sw.js:1
(anonymous) @ sw.js:1
(index):6 service worker error TypeError: Failed to register a ServiceWorker: ServiceWorker script evaluation failed

This test project is currently deployed on https://fitz-test.firebaseapp.com/ where you can see the errors

Related code:

https://github.com/yannickvg/ionic-virtualscroll

Other information: No other information

silverio commented 6 years ago

Hi @yannickvg I am having the same issue, did you find a solution?

newpointmedia commented 6 years ago

Just spun up a new project and having the same issue @yannickvg

jgw96 commented 6 years ago

Hello all! I just pushed an update to fix this issue, thanks!