I am upgrading my rails app from ruby 2.4 to ruby 3.2.2 and from rails 5 to rails 7.0.4.3. After upgrading a bunch of gems and getting the app up and running, I started getting the above error. The error occurs when I click a button that is meant to create an overlay where you can select a start and end date to filer a report. This is the back trace:
- - [18/Mar/2024:11:18:52 -0400] "GET / HTTP/1.0" 302 103 0.0168
Started GET "/reports/report_params/jvcd_history" for XXXXXXX at 2024-03-18 11:18:53 -0400
ActionDispatch::Http::MimeNegotiation::InvalidType ("html" is not a valid MIME type):
I am using mimemagic. I am not using sentry-ruby. I tried upgrading mimemagic to the latest version (0.4.3) but that hasn't worked.
I also checked my Rack::Mime::MIME_TYPES and html is certainly there.
I tried creating an exception handler but that's not really the route I want to go because I think there is something else going on here.
I also tried adding a defaults: { format: 'html' } in routes.rb for the route but that didnt work either.
Thanks to the comments I was able to find a .js file that had
contentType: "html"instead ofcontentType: "text/html". Making that change fixed the error for me!