如何解决新 Rails 应用程序上的 Firebase Service Worker 路由错误
我使用 rails new
创建了一个全新的 Rails 应用。每当我启动应用程序 (bin/rails server
) 并访问任何页面(默认 Rails 页面或手动生成的页面)时,都会记录到控制台:
Started GET "/firebase-messaging-sw.js" for ::1 at 2021-02-26 14:24:04 +0100
ActionController::RoutingError (No route matches [GET] "/firebase-messaging-sw.js"):
actionpack (6.0.3.5) lib/action_dispatch/middleware/debug_exceptions.rb:36:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.3.5) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.5) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.3.5) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.3.5) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.3.5) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.3.5) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.3.5) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.5) lib/action_dispatch/middleware/host_authorization.rb:82:in `call'
webpacker (4.3.0) lib/webpacker/dev_server_proxy.rb:23:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (6.0.3.5) lib/rails/engine.rb:527:in `call'
puma (4.3.7) lib/puma/configuration.rb:228:in `call'
puma (4.3.7) lib/puma/server.rb:713:in `handle_request'
puma (4.3.7) lib/puma/server.rb:472:in `process_client'
puma (4.3.7) lib/puma/server.rb:328:in `block in run'
puma (4.3.7) lib/puma/thread_pool.rb:134:in `block in spawn_thread'
页面仍然可以正常工作,但是这个输出很烦人并且隐藏了其他重要消息。如何禁用尝试初始化 Firebase 的任何内容?我试过搜索,但在 Rails 应用程序中没有提到 firebase
。这一定意味着它来自某种外部依赖。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。