plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

No 'Access-Control-Allow-Origin' header is present on the requested resource. #617

Closed 8Observer8 closed 3 months ago

8Observer8 commented 3 months ago

Hello,

I try to set up the Box2D-WASM library using import maps: https://plnkr.co/edit/BGNYcIJRiJXpd9N4?preview

    <script type="importmap">
        {
            "imports": {
                "box2d-wasm": "https://unpkg.com/box2d-wasm@7.0.0/dist/es/Box2D.js",
                "gl-matrix": "https://cdn.jsdelivr.net/npm/gl-matrix@3.4.3/+esm"
            }
        }
    </script>

But I have this error: Access to script at 'https://unpkg.com/box2d-wasm@7.0.0/dist/es/Box2D.js' from origin 'https://run.plnkr.co' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

8Observer8 commented 3 months ago

This link works: https://cdn.jsdelivr.net/npm/box2d-wasm@7.0.0/dist/es/entry.js

    <!-- Since import maps are not yet supported by all browsers, its is
        necessary to add the polyfill es-module-shims.js -->
    <script async src="https://unpkg.com/es-module-shims@1.9.0/dist/es-module-shims.js"></script>

    <script type="importmap">
        {
            "imports": {
                "box2d-wasm": "https://cdn.jsdelivr.net/npm/box2d-wasm@7.0.0/dist/es/entry.js",
                "gl-matrix": "https://cdn.jsdelivr.net/npm/gl-matrix@3.4.3/+esm"
            }
        }
    </script>