Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

localhost tries to grab service-worker.js route on different apps that have nothing to do with the file #188

Closed
acreilly opened this issue Sep 20, 2016 · 2 comments

Comments

@acreilly
Copy link

acreilly commented Sep 20, 2016

When I run different apps on localhost that do not use service-worker, the apps still try to hit the endpoint /service-worker.js

Started GET "/service-worker.js" for 127.0.0.1 at 2016-09-20 16:50:57 -0400

ActionController::RoutingError (No route matches [GET] "/service-worker.js"):
  actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `call'
  quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
  request_store (1.1.0) lib/request_store/middleware.rb:8:in `call'
  actionpack (4.2.5.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.5.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  dragonfly (1.0.12) lib/dragonfly/cookie_monster.rb:9:in `call'
  actionpack (4.2.5.1) lib/action_dispatch/middleware/static.rb:116:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  rack-utf8_sanitizer (1.3.2) lib/rack/utf8_sanitizer.rb:19:in `call'
  honeybadger (2.5.3) lib/honeybadger/rack/error_notifier.rb:33:in `block in call'
  honeybadger (2.5.3) lib/honeybadger/config.rb:198:in `with_request'
  honeybadger (2.5.3) lib/honeybadger/rack/error_notifier.rb:30:in `call'
  honeybadger (2.5.3) lib/honeybadger/rack/user_feedback.rb:28:in `call'
  honeybadger (2.5.3) lib/honeybadger/rack/user_informer.rb:18:in `call'
  railties (4.2.5.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.5.1) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  puma (3.2.0) lib/puma/configuration.rb:227:in `call'
  puma (3.2.0) lib/puma/server.rb:561:in `handle_request'
  puma (3.2.0) lib/puma/server.rb:406:in `process_client'
  puma (3.2.0) lib/puma/server.rb:271:in `block in run'
  puma (3.2.0) lib/puma/thread_pool.rb:111:in `block in spawn_thread'

How do I make it stop?

@jeffposnick
Copy link
Contributor

Service worker registrations persist across browser restarts, and it's unfortunately common to have an older registration retain control of a common localhost:port combination that's then reused for a different project.

You can unregister the current service worker controlling a page by running

navigator.serviceWorker.getRegistration().then(r => r.unregister())

in the JavaScript console of Chrome's DevTools.

You can see a list of all service worker registrations and unregister them manually in the Applications panel of Chrome's DevTools, after clicking on the "Show all" button if needed.

@tunacasserole
Copy link

tunacasserole commented Jun 29, 2018

jeffposnick - I so love you right now! Thank you for that!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants