# Storing staticfiles on a separate subdomain

**URL:** https://pdfjs.community/t/storing-staticfiles-on-a-separate-subdomain/828
**Category:** Technical Support
**Created:** [June 18, 2021, 4:52am UTC](https://pdfjs.community/t/storing-staticfiles-on-a-separate-subdomain/828 "2021-06-18T04:52:28Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![accounts2](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/accounts2/32/460_2.png) [@accounts2](https://pdfjs.community/u/accounts2)
#### Post date: [June 18, 2021, 4:52am UTC](https://pdfjs.community/t/storing-staticfiles-on-a-separate-subdomain/828/1 "2021-06-18T04:52:28Z")

</div>

**PDF.js Express Version**

```javascript
|Core version|"7.3.3"|
|Build|"Ni80LzIwMjF8OThhMTM2NjE0"|
|WebViewer Server|false|
|Full API|false|

```

**Detailed description of issue**  
My static files are hosted on a different subdomain. The iframe src/dest is on the same domain, it’s just the JS files that are on a separate subdomain.

I’m getting the following error:

```javascript
Uncaught (in promise) Error: Setting up fake worker failed: "Cannot read property 'WorkerMessageHandler' of undefined".
    at PDFJSDocumentType.js:960

```

So the browser is obviously blocking inter-subdomain communication somewhere and returning undefined.

I’ve seen a similar error with PDF.JS when I was setting that up independently once, I needed something like:

```javascript
  PDFJS.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/1.10.100/pdf.worker.min.js';

```

I’ve found other similar github issues where they recommend something like:

```javascript
pdfjs.GlobalWorkerOptions.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;

```

How do I access the underlying PDF.js from pdfexpress?

Any ideas?

**Expected behaviour**  
N/A

**Does your issue happen with every document, or just one?**  
All documents.

**Link to document**  
N/A

**Code snippet**

```javascript
<!doctype html>
<html moznomarginboxes mozdisallowselectionprint>

<head>
  <base href="https://app-static.onuptick.com/static/pdfjsexpress/public/ui/">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  <link rel="stylesheet" href="style.css">
  <title>WebViewer UI</title>
</head>

<body>
  <div id="app"></div>
  <div id="line-connector-wrapper">
    <div id="line-connector-root"></div>
  </div>
  <script src="../core/CoreControls.js"></script>
  <script src="../core/pdfjs/PDFJSDocumentType.js"></script>
  <script src="../core/pdfjs/UIConfig.js"></script>
  <script src="webviewer-ui.min.js"></script>
</body>

</html>

```

---

_[View the full topic](https://pdfjs.community/t/storing-staticfiles-on-a-separate-subdomain/828)._
