JavaScript SDK, CDN hosted version not reporting events

I followed the instructions to integrate the JavaScript SDK however events do not get triggered at all.

Only once I remove the the crossorigin attribute on the script tag loading Sentry from the CDN or add the attribute to my site scripts it seems to work but that doesn’t feel like the the right thing to do.

See below for a simplified version of my setup.

<!DOCTYPE html>
        dsn: 'https://<dsn><no>',
    <script type="text/javascript" src="/main.js"></script>

What am I missing and how do I get it to work?