Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrowserSync Client sporadically generates an Uncaught TypeError #2085

Open
2 tasks done
thomaspatrickwelborn opened this issue Aug 13, 2024 · 0 comments
Open
2 tasks done

Comments

@thomaspatrickwelborn
Copy link

thomaspatrickwelborn commented Aug 13, 2024

Issue details

BrowserSync Client sporadically generates an Uncaught TypeError.

Error

browser-sync-client.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'socketConfig')
    at e.initSocket (browser-sync-client.js:1:26836)
    at browser-sync-client.js:1:180515
    at browser-sync-client.js:1:181484
    at browser-sync-client.js:1:181487

Effect

BrowserSync features ARE FUNCTIONAL regardless whether err generated or not.

Expectation

BrowserSync should not generate errors or innocuous errors should have suppressability.

Steps to reproduce/test case

  1. Create BrowserSync Instance
  2. Initialize BrowserSync Instance
  3. Open browser at ACCURATE_URL
  4. Load BrowserSync Client Script Source
  5. Refresh page or reload application multiple times at different intervals to generate error.

Reproduction Notes

Error sometimes appears, sometimes does not appear.

Browsersync, node, npm versions

  • Browsersync [v3.0.2]
  • Node [v22.4.0]
  • Npm [v10.8.2]

Affected platforms

  • linux

Browsersync use-case

  • API

BrowserSync API Init

const browserSyncServerOptions = {
  ui: false,
  open: false, 
  https: {
    key: 'ACCURATE_PATH_HERE.key,
    cert: 'ACCURATE_PATH_HERE.crt',
  },
  host: ACCURATE_DOMAIN,
  port: ACCURATE_PORT_NUMBER,
  proxy: {
    target: 'https://ACCURATE_DOMAIN:ACCURATE_PORT_NUMBER',
    ws: false,
  },
  files: [
    path.join(process.env.PWD, 'localhost/**/*'),
    path.join(process.env.PWD, 'static/dependencies/**/*'),
  ],
}
const browserSyncServer = browserSync.create()
browserSyncServer.init(browserSyncServerOptions)

BrowserSync Client Snippet

<script async id="__bs_script__" src="/dependencies/browser-sync-client.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant