Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service worker show error in console while deploying to firebase #2308

Closed
andrantis opened this issue May 21, 2017 · 6 comments
Closed

Service worker show error in console while deploying to firebase #2308

andrantis opened this issue May 21, 2017 · 6 comments

Comments

@andrantis
Copy link

Description

I'm trying to publish a simple app to firebase just to try the new pwa stuff. I'm not sure what I'm doing wrong, After publishing and accesing the app I see a bunch of erors in the console and the service worker doesn't seem to be working. It seem like the sw has the local paths to the chunks hardcoded.

Expected behavior

App would be deployed, run without errors ad sw would work.

Actual behavior

App runs but get th error below in the browser console:

service-worker.js:1 Fetch API cannot load file:///D:/projects/pwa/test1/build/static/css/main.9a0fe4f1.css. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ service-worker.js:1
(anonymous) @ service-worker.js:1
service-worker.js:1 Fetch API cannot load file:///D:/projects/pwa/test1/build/static/js/main.11406a5c.js. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ service-worker.js:1
(anonymous) @ service-worker.js:1
service-worker.js:1 Fetch API cannot load file:///D:/projects/pwa/test1/build/static/media/logo.5d5d9eef.svg. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ service-worker.js:1
(anonymous) @ service-worker.js:1
service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch
    at https://react-pwa-d6f69.firebaseapp.com/service-worker.js:1:2076
    at Array.map (native)
    at https://react-pwa-d6f69.firebaseapp.com/service-worker.js:1:1990
    at <anonymous>

Environment

  1. react-scripts: 1.0.0
  2. node -v: 6.2.1
  3. npm -v: 3.9.3
  4. Operating system: Windows 10
  5. Browser and version: Chrome 58

Reproducible Demo

https://github.com/andrantis/react-pwa-test/tree/default-sw

https://react-pwa-d6f69.firebaseapp.com/

@Timer
Copy link
Contributor

Timer commented May 21, 2017

Hi @andrantis! It looks like you need to upgrade to react-scripts@1.0.2 which contains a fix for windows users.

@andrantis
Copy link
Author

andrantis commented May 21, 2017

Ah.. yes, that did the trick. You guys move fast with the updates. Thanks!

@andrantis
Copy link
Author

@Timer Just curious, could you point me to the commit that fixes that issue?

@Timer
Copy link
Contributor

Timer commented May 26, 2017

22ca584

@andrantis
Copy link
Author

Thanks!

@Timer
Copy link
Contributor

Timer commented May 26, 2017

No problem! 😄 Let me know if you need anything.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants