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

Error: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) #32

Open
martinadamek opened this issue May 25, 2020 · 2 comments

Comments

@martinadamek
Copy link

Hi, first of all thanks for the library and explanatory blogpost. I am trying it with my app and seeing this trace in console. Any idea, where to look at to find out what's going on? Using turbolinks_render (0.9.20).

8:24:31 AM web.1 | 2020-05-25 08:24:31 +0200: Rack app error handling request { POST /users } 8:24:31 AM web.1 | #<Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)> 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionview-6.0.3.1/lib/action_view/helpers/javascript_helper.rb:34:ingsub'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionview-6.0.3.1/lib/action_view/helpers/javascript_helper.rb:34:in escape_javascript' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/turbolinks_render-0.9.20/lib/turbolinks_render/middleware.rb:46:in js_code_to_render_html'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/turbolinks_render-0.9.20/lib/turbolinks_render/middleware.rb:23:in turbolinks_body' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/turbolinks_render-0.9.20/lib/turbolinks_render/middleware.rb:87:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.0.3.1/lib/rails/rack/logger.rb:37:in call_app' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.0.3.1/lib/rails/rack/logger.rb:26:in block in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb:80:in block in tagged' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb:28:in tagged'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/tagged_logging.rb:80:in tagged' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.0.3.1/lib/rails/rack/logger.rb:26:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in call' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/remote_ip.rb:81:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/request_id.rb:27:in call' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.2/lib/rack/method_override.rb:24:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.2/lib/rack/runtime.rb:22:in call' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/executor.rb:14:in call' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/static.rb:126:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.2/lib/rack/sendfile.rb:110:in call' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/host_authorization.rb:82:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/webpacker-5.1.1/lib/webpacker/dev_server_proxy.rb:25:in perform_request' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.0.3.1/lib/rails/engine.rb:527:in call' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/configuration.rb:228:in call'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/server.rb:713:in handle_request' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/server.rb:472:in process_client'
8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/server.rb:328:in block in run' 8:24:31 AM web.1 | /Users/martin/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/puma-4.3.5/lib/puma/thread_pool.rb:134:in block in spawn_thread'
`

@martinadamek
Copy link
Author

I have found that the problem on my side was gzip compression of the served content:
config.middleware.use(Rack::Deflater)
Some more info at https://thoughtbot.com/blog/content-compression-with-rack-deflater

@martinadamek
Copy link
Author

Other usages of Turbolinks worked without a problem, so not sure this is problem in turbolinks_render yet.

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

No branches or pull requests

1 participant