CORS issue with rhino3dm.wasm on the frontend

Please take a look at this screenshot. I’ve modified the codebase to solve this problem before, since then I have had no problems.

However, the strange thing just happened today, out of nowhere… My colleague got this issue this morning and they are based outside of the US, but the people who are in the US are not getting this error at all.
image

This is how I load the rhino3dm in the html, again I had no problems with this code before until today. Please help… completely out of hands:

<script>
    window.addEventListener('DOMContentLoaded', () => {
        // Wait for the DOM to be fully loaded
        
        const scripts = [
            'https://files.mcneel.com/rhino3dm/js/latest/rhino3dm.js',
        ];

        let script = document.createElement('script');
        script.src = scripts[0];
        document.head.appendChild(script);
        script.onerror = (err) => {
            console.log(err);
        };
        script.onload = () => {
          window.Rhino3dm = window.rhino3dm();
          console.log('Rhino3dm loaded:', window.Rhino3dm);
        };
    });
</script>

Reporting back to this issue:
I think we have found the reason that caused this strange issue. The rhino3dm.js URL https://files.mcneel.com/rhino3dm/js/latest/rhino3dm.js returns CORS error, and I think this URL points to the latest rhino3dm.js 8.6.0 version. Only this version returns CORS error for my colleague who is outside of the US…
However, as soon as we change the URL to https://unpkg.com/rhino3dm@8.0.1/rhino3dm.js solves the problem and rhino3dm.js finally works again. It seems like 8.0.1 is working properly but not the 8.6.0

Hopefully this discovery helps the rhino team.

Please do not use https://files.mcneel.com/rhino3dm/js/latest/rhino3dm.js. If it is recommended or suggested to do this in some article we’ve posted, please let me know so I can edit it.

Also, you should be able to use https://unpkg.com/rhino3dm@8.4.0/rhino3dm.js

1 Like