Closed firefoxic closed 9 months ago
I tried it, and it worked for me on Node 20 actually! Wasn't able to reproduce. However with that index.html, live reload won't work.
Live reload requires a <body>
like this:
echo '<body>hello</body>' > index.html
The body tag has to be present for the script injection to work (I think it is possible browser-sync could simply inject the script regardless).
Thanks for the ping, yep I'll look at this ASAP :)
@trusktr
I think it is possible browser-sync could simply inject the script regardless
I tried that before, it's way too problematic - I know the restriction is annoying, but you can always configure https://browsersync.io/docs/options#option-snippetOptions to get around it.
I updated the GitHub actions to run on Node 20 now - and everything is passing.
@firefoxic - could you try with a more realistic HTML example and report back if it's working for you :)
Issue details
The problem was noticed when using
browser-sync
viagulp
. But it turned out that it had nothing to do withgulp
. Both methods I used to startbrowser-sync
(CLI andgulp
), which worked fine up to and includingnode@19
, turned out not to work innode@20
.Steps to reproduce/test case
Install
node@20
with any node version manager, such asnvm
,nvs
orvolta
.Create a test directory and move into it:
Create the minimum required
index.html
:Try to start the server:
Please specify which version of Browsersync, node and npm you're running
Affected platforms
Browsersync use-case
If CLI, please paste the entire command below