Instant Reload detecting changes, but console error happens and no reload

What issue or error are you experiencing?

Instant Reload is detecting changes, but this error happens in the console and the page doesn’t reload. I get the same behavior with a brand new site running a default theme, whether I’m compiling css or editing a vanilla css file (style.css in twentytwenty, for example).

I also get the behavior in local router mode. I’m loading over http. I get the same error with apache or nginx, with Xdebug on or off.

Here’s the error:

browser-sync-client.js?v=2.26.9:9 Uncaught TypeError: Cannot read properties of null (reading ‘indexOf’)
at e.splitUrl (browser-sync-client.js?v=2.26.9:9:27645)
at e.pathFromUrl (browser-sync-client.js?v=2.26.9:9:27829)
at browser-sync-client.js?v=2.26.9:18:24553
at browser-sync-client.js?v=2.26.9:9:28120
at Array.forEach ()
at e.pickBestMatch (browser-sync-client.js?v=2.26.9:9:28067)
at x (browser-sync-client.js?v=2.26.9:18:24513)
at browser-sync-client.js?v=2.26.9:18:21265
at e.project (browser-sync-client.js?v=2.26.9:16:46445)
at e._tryNext (browser-sync-client.js?v=2.26.9:9:19341)

I should note: I always have gotten an error when instant reload loads, but it’s worked before while this other error was present:

browser-sync-client.js?v=2.26.9:18 WebSocket connection to ‘ws://biolime-2025.local/browser-sync/socket.io/?EIO=3&transport=websocket&sid=PRXpqlEiVmK7iihIAAAA’ failed:

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:
    Version 9.2.3+6776

  • Operating System (OS) and OS version:
    MacOS 15.3.1 (24D70)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

I have a lot of logs, maybe 20 files, but can’t tell what’s recent and what’s not.


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi, @redblue! Thanks for the report.

I couldn’t reproduce this with macOS 15, Local 9.2.3 and Instant Reload 1.1.4. Are you running the latest version of Instant Reload (currently 1.1.4)?

If so, and if you’re not running any security software or network filters that could be blocking the connection (like Little Snitch or similar) please could you share your logs? local-lightning-verbose0.log is the latest.

Here’s the log!
local-lightning-verbose0.log (947.7 KB)

Not running any network software to my knowledge, and Instant Reload is 1.1.4.

I do think that something’s changed in the recent past – and it could be something else on my computer, as it doesn’t look like IR has updated all that recently.

I should also mention that I’ve tried it in a number of browsers after it wasn’t working in Chrome, but seeing the same error in those as well.

Thanks for the logs, @redblue!

I don’t see anything there that would cause Instant Reload to fail with the connection error you saw.

I did find this post in the browser-sync repo that matches your error, though: Uncaught TypeError: Cannot read property 'indexOf' of null · Issue #1504 · BrowserSync/browser-sync · GitHub

It suggests that invalid HTML markup could cause the issue:

I had the same error. Only by debugging I found, that having empty “link” tag is crashing browsersync:

<link rel="stylesheet">

One user notes that browser extensions like Dark Mode can inject invalid HTML content in a page that would otherwise run fine. I know you’ve tried a fresh site and multiple browsers, but sharing in case this is helpful to you. You could perhaps try:

  • Opening the site in an incognito/private browser window (which normally doesn’t use extensions unless you’ve explicitly allowed them).
  • Validating the page’s HTML in case an active theme/plugin is outputting invalid markup.

All my tests running locally work fine, suggesting it could be browser configuration or environment -specific.

That’s interesting. ChatGPT also suggested that a global node.js installation of a different version than a bundled one might crash it. Is that remotely plausible?

I’ll look into the invalid markup thing – though I’d think that trying the combination of different browsers on a blank site with no plugins probably would have caught that one.

OH MY GOODNESS. I looked manually through my code and it was the dark mode extension. I have no idea how this could have broken things in other browsers (maybe I had chrome open at the same time?). Probably it was also enabled in incognito.

Dark mode extension inserts two stylesheets without href parameters.

THANK YOU SO MUCH!!! It’s been driving me nuts and slowing everything down for a couple of weeks now.

1 Like

Glad you figured it out, @redblue! Thank you for persevering and letting us know.

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