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

2.27.10 client js not working #1968

Open
1 of 6 tasks
giantads opened this issue Jun 7, 2022 · 3 comments
Open
1 of 6 tasks

2.27.10 client js not working #1968

giantads opened this issue Jun 7, 2022 · 3 comments

Comments

@giantads
Copy link

giantads commented Jun 7, 2022

Issue details

2.27.9 has been working fine, when I upgraded to 27.10 it fails with JS error and not reloading browser window anymore.
Installed with yarn, and my package.json shown below. If I install this with yarn, it installs 2.27.10 instead of 2.27.9.
If I replace packages in node_modules to the 2.27.9 everything is working fine again.

Steps to reproduce/test case

yarn install
yarn run watch

JS Error message
[Error] TypeError: F is not a function. (In 'F({},pm)', 'F' is undefined)
r (browser-sync-client.js:11:108785)
qs (browser-sync-client.js:11:110513)
(anonymous function) (browser-sync-client.js:11:133367)
Global Code (browser-sync-client.js:11:134203)

Package.json
"scripts": {
"start": "mix --mix-config=webpack/start.mix.js",
"watch": "mix watch --mix-config=webpack/watch.mix.js",
"prod": "mix --mix-config=webpack/prod.mix.js --production"
},
"devDependencies": {
"browser-sync": "2.27.9",
"browser-sync-webpack-plugin": "^2.3.0",
"copy-webpack-plugin": "^9.0.0",
"cssnano": "^5.0.5",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-webp-webpack-plugin": "^3.3.4",
"imagemin-webpack-plugin": "^2.4.2",
"laravel-mix": "6.0.18",
"laravel-mix-pug": "^0.3.0",
"laravel-mix-purgecss": "^6.0.0",
"postcss": "^8.3.0",
"postcss-prettify": "^0.3.4",
"pug": "^3.0.2",
"remove-files-webpack-plugin": "^1.4.5",
"sass": "^1.34.1",
"sass-loader": "^12.0.0",
"webpack-cli": "^4.9.2"
},

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [2.27.10]
  • Node [18.3.0]
  • Npm [8.11.0]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)
@felixranesberger
Copy link

Are you using require.js in conjunction with browser-sync?
The solution for the problem in our case was to no longer load the browser-sync client asynchronously, this can be configured via the snippetOptions.

After that it worked again for us.

https://gist.github.com/felixranesberger/f1be9b183131115a80b1ca29a4141e04

@jamesg1
Copy link

jamesg1 commented Aug 1, 2022

@felixranesberger Thanks so much for that answer, worked like a charm!

@felixranesberger
Copy link

Glad that the solution worked for you as well 👌🏻

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

3 participants