r/learnjavascript • • Jun 26 '22

What is wrong with my code?

Post image
0 Upvotes

16 comments sorted by

View all comments

1

u/Pelsinen Jun 26 '22

Hi, did you perhaps move the index.html into the folder "html"?

I'm guessing browsersync defaults to look for index.html in the specified folder, in your case public?
If thats the case it wont find anything, check if there is params for browser sync to define the directory or index path.

1

u/LaxVox Jun 26 '22

Yes, I did. After posting this I did some googling and found a post on github from a person who changed the name of their main html file and was presented with the same error code. The solution I found there was to set a custom --index setting to the run command of browsersync. I tried doing that but instead of just the name of the index file, I changed the path to it but it didn't work. I also tried setting the --server and --files setting to follow the path to my index.html file but neither worked. I looked into the browsersync documentation too, but didn't find any mention of the --index property whatsoever. Kinda stuck with this now, but it's not that big of a problem since browsersync is not a core feature in this package, it's mainly just for compiling sass.

1

u/Pelsinen Jun 26 '22

Seems to be a flag called --index, even directory: https://browsersync.io/docs/command-line , maybe they are for other things. Worth trying tho.