Rails <script> tag in <head> having random string in "type" attribute and therefore not loading JS

100 Views Asked by At

In my Ruby on Rails website, script tags in head get assigned random string in type attribute. It only happens on a single page though. All other pages are fine and the correct type="text/javascript" is used. Therefore, on that page scripts aren't being loaded and I have to fix it.

It only happens in production.

Noticed that all scripts have exactly the same string prepended before text/javascript and it changes on each reload.

Absolutely have no idea where to even start. Maybe you could help out?

Screenshot of script tag in head from DevTools

1

There are 1 best solutions below

0
steve On

I'm guessing you figured this out... we noticed this happens when you are using Cloudflare and have enabled their Rocket Loader feature.