In nginx settings on the yunohost server, I tried both content-types – application/javascript (even though this is ol’ school) and text/javascript. I also tried turning meddling with the nosniff setting in content-type-options.
With the nosniff option I see this error, relating to the generated matomo.js file.
Error: Uncaught SyntaxError: expected expression, got '<'
This feels like a red herring to me – that the file isn’t loading properly. I don’t think this is a bug with matomo. So I restored the nginx settings.