# NPM project loading from CDN?

**URL:** <https://devforum.zoom.us/t/npm-project-loading-from-cdn/71110>\
**Category:** Web\
**Created:** [June 24, 2022, 11:13pm UTC](https://devforum.zoom.us/t/npm-project-loading-from-cdn/71110 "2022-06-24T23:13:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.kantor](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael.kantor/32/38795_2.png) [@michael.kantor](https://devforum.zoom.us/u/michael.kantor)\
**Post date:** [June 24, 2022, 11:13pm UTC](https://devforum.zoom.us/t/npm-project-loading-from-cdn/71110/1 "2022-06-24T23:13:23Z")

</div>

**Description**  
Current Result: NPM imported code is loading more code from CDN triggering " CORS errors.  
Expected result: NPM imported code contains all code that needs to import so no CORS errors.

**Browser Console Error**

```auto
Refused to load the script 'https://dmogdx0jrul3u.cloudfront.net/videosdk/1.3.0/lib/js_media.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' ....<removed due to forum rules about many links>... Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

```

This error is then logged:

```auto
{ 
    reason: "depedent assets are not accessible"
    type: "INVALID_PARAMETERS"
}

```

**Which Web Video SDK version?**

```auto
"name": "@zoom/videosdk",
"version": "1.3.0",

```

\*\* Code Example \*\*

```auto
import ZoomVideo from '@zoom/videosdk';

...

async function setupCall() {
      clientRef.current = ZoomVideo.createClient();
      clientRef.current.init('en-US', 'CDN');
      await clientRef.current.join(name, signature, userName, password);
      const localStream = clientRef.current.getMediaStream();
      setStream(localStream);
      localStream.startVideo({ videoElement: videoPlayerRef.current });
}

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [June 27, 2022, 5:42am UTC](https://devforum.zoom.us/t/npm-project-loading-from-cdn/71110/2 "2022-06-27T05:42:37Z")

</div>

Hey @michael.kantor

Thanks for your feedback.

From the console error on the browser, it seems to be related to the [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). Could you please check the CSP setting on your site?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 27, 2022, 3:43pm UTC](https://devforum.zoom.us/t/npm-project-loading-from-cdn/71110/3 "2022-07-27T15:43:11Z")

</div>

Closed on July 27, 2022, 3:43pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
