JS <script> loaded within <turbo-frame id="x" src="/y"> runs locally, fails production

This worked for me with vanilla JS (where #content-blocks is the turbo-frame ID)

document.querySelector("#content-blocks").loaded.then(() => {
  ...
  })
1 Like