Page 1 of 1

Characters added to url when using browser-sync

PostPosted: 05. July 2022 23:44
by jmikrut
I have a WordPress dev installation and I am trying to run automation with browser-sync. The url that should come up is localhost:3000/bbh/. What is coming up is localhost/%27bbh/%27. The automation is started with npm run preview. I'm relatively new and have no idea how to fix this.

This Brad Schiff boilerplate code. All I did was substitue my domain 'bbh' in the "sync" script.

My WordPress installation is in htdocs/bbh

Here are the scripts.
Code: Select all
"scripts": {
    "preview": "npm-run-all --parallel sync wpstart tailwindwatch",
    "sync": "browser-sync start -p 'bbh' --files '**/*.php' 'build/*.js' 'build/*.css'",
    "buildwp": "wp-scripts build",
    "build": "npm-run-all --sequential buildwp tailwindbuild",
    "wpstart": "wp-scripts start",
    "start": "npm-run-all --parallel wpstart tailwindwatch",
    "tailwindbuild": "tailwindcss -i ./src/index.css -o ./build/index.css --minify",
    "tailwindwatch": "tailwindcss -i ./src/index.css -o ./build/index.css --watch --minify",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

Re: Characters added to url when using browser-sync

PostPosted: 08. July 2022 02:51
by jmikrut
I did solve the %27 problem. Switching the ' to " and putting a \ before solved it. I also had to add localhost (i.e. \"localhost/bbh/\"). It now spins up the web site and automatically refreshes.

Re: Characters added to url when using browser-sync

PostPosted: 12. March 2023 04:42
by richardferrym
nice, i have also this problem