# XMLHttpRequest cannot load hot-update.json due to access control checks

**URL:** https://discourse.roots.io/t/xmlhttprequest-cannot-load-hot-update-json-due-to-access-control-checks/12145
**Category:** sage
**Tags:** webpack, sage9
**Created:** 2018-04-08T00:29:17Z
**Posts:** 9

## Post 1 by @broskees — 2018-04-08T00:29:17Z

Seems as though the initial page load works with Sage but when Browsersync reloads the page, nothing changes.

I noticed these errors in the console:

```
[Error] Origin http://localhost:3002 is not allowed by Access-Control-Allow-Origin.
[Error] Failed to load resource: Origin http://localhost:3002 is not allowed by Access-Control-Allow-Origin. (2e1ebcbd6a2e8ebb9a87.hot-update.json, line 0)
[Error] XMLHttpRequest cannot load http://localhost:3000/app/themes/ssafd-theme/dist/2e1ebcbd6a2e8ebb9a87.hot-update.json due to access control checks.
[Error] Unhandled Promise Rejection: Error: Manifest request to http://localhost:3000/app/themes/ssafd-theme/dist/2e1ebcbd6a2e8ebb9a87.hot-update.json timed out.
	(anonymous function) (main.js:40)
	promiseReactionJob
```

Has anyone seen anything like this before?

---

## Post 2 by @broskees — 2018-04-08T20:17:20Z

Any thoughts? Don’t want this to get buried.

---

## Post 3 by @ben — 2018-04-10T04:10:56Z

What does your local development setup/server look like?

Is `resources/assets/config.json` configured properly?

---

## Post 4 by @broskees — 2018-04-17T04:56:57Z

I’m running trellis/bedrock, on my Mac OS High Sierra 10.13.3 (17D102)

Here’s my `resources/assets/config.json` configuration:

```
{
  "entry": {
    "main": [
      "./scripts/main.js",
      "./styles/main.scss"
    ],
    "customizer": [
      "./scripts/customizer.js"
    ]
  },
  "publicPath": "/app/themes/ssafd-theme",
  "devUrl": "http://syracusesedationandfamilydentistry.test",
  "proxyUrl": "http://localhost:3000",
  "cacheBusting": "[name]_[hash:8]",
  "watch": [
    "app/**/*.php",
    "config/**/*.php",
    "resources/views/**/*.php"
  ]
}
```

As far as I know it’s configured properly.

---

## Post 5 by @ben — 2018-04-18T00:44:45Z

Browsersync is running on port 3002 for you because something is already running on 3000

The `proxyUrl` isn’t currently able to detect when BS changes its port

Can you kill whatever is running on port 3000 and try again? `fkill` is good for this:

```
yarn global add fkill-cli
fkill :3000
```

Then try running `yarn start` again and seeing if it loads your BS session at `http://localhost:3000` instead of `http://localhost:3002`

---

## Post 6 by @strarsis — 2018-04-18T03:05:36Z

Could this be related?:

> [@Sage 9 + BrowserSync not loading any CSS at all on 'yarn run start'](https://discourse.roots.io/t/sage-9-browsersync-not-loading-any-css-at-all-on-yarn-run-start/11332/26):
>
> @Simeon: Edit: According to author BrowserSync has to be configured with advanced key: new BrowserSyncPlugin({ target, open: config.open, proxyUrl: config.proxyUrl, watch: config.watch, delay: 500, advanced: { browserSync: { cors: true, }, }, }), Related issues:

---

## Post 7 by @broskees — 2018-04-21T19:55:55Z

> [@ben](#):
>
> fkill :3000

Ran this, getting this as a result:

```
fkill :3000  ✔  1732  15:50:59

? Error killing process. Would you like to use the force? Yes
AggregateError:
    Error: Killing process 29683 failed: Process doesn't exist
        at Array.map (<anonymous>)
        at processExists.all.then.then (/Users/josephroberts/.config/yarn/global/node_modules/fkill/index.js:83:10)
        at <anonymous>
    at processExists.all.then.then (/Users/josephroberts/.config/yarn/global/node_modules/fkill/index.js:83:10)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)
```

Unfortunately it’s not playing nice. Is there a way to see what’s possibly running on that port?

---

## Post 8 by @ben — 2018-04-21T19:57:36Z

You could just update `proxyUrl` to use a different port

---

## Post 9 by @broskees — 2018-04-23T21:50:06Z

That worked, thanks Ben.
