Snippet can't be loaded from server
See original GitHub issue<script type='text/javascript' id="__bs_script__">//<![CDATA[
document.write("<script async src='http://HOST:3000/browser-sync/browser-sync-client.2.8.0.js'><\/script>".replace("HOST", location.hostname));
//]]></script>
Issue Analytics
- State:
- Created 8 years ago
- Comments:34 (12 by maintainers)
Top Results From Across the Web
code snippets not working - Visual Studio Feedback
When i'm trying using any code snippet like "prop" it does not show up in the list. And if i type "prop" and...
Read more >VS13/VS15 - can't import SQL snippet - Stack Overflow
I fixed this by going into the snippet manager and specifying the Language, VB or CSharp, and adding the snippets to the correct...
Read more >Problem with Code Snippets that use JavaScript - Zoho Cares
You may add the code in the same format that you mentioned and check if it makes any difference. If not, kindly enable...
Read more >Tips for Using Snippets in Your Shopify Theme Work
If you have worked with server-side languages you will already be familiar ... Similarly, variables assigned within the snippet can't be ...
Read more >Code Snippets - CKEditor 4 Documentation
The optional Code Snippet plugin allows you to insert rich code fragments and ... the highlighter stylesheet will not be loaded automatically by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding my experience with this issue and what so far has become my workaround…
Starting with a fully working app that uses browser-sync with no issues. I make a copy of this working go-to starter kit project, change minor textual issues (project name, etc.) and run the app in development mode, where index.html loads with no problem, until about a week ago and every time since – the start page in the browser-sync development server, has a 404 for browser-sync-client.2.8.2.js – as mentioned by others above.
After days of hunting this down and following various false leads, unsuccessfully, I did something similar to what I see suggested in a comment above: Before the closing </body> tag of my start page I manually entered:
Subsequent loading of the start page, no longer contains the 404, the page and site run without issues and the following code gets inserted as the first lines after the opening <body> tag:
Next, I remove the script tag I manually entered. The very next run of the app and the start page load, everything works correctly, no 404s and the same lines as above are inserted into the document.
So my workaround is to manually enter the script once that references browser-sync-client.js no version, load the site. close the site, remove the manually entered script, and from then on everything is fine.
This feels like somehow a reference to 2.8.2 is cached or lying around somewhere, that after manually entering the client script reference, it flushes that, and thereafter the correct script reference gets inserted.
Any updates on this issue or know of a better workaround, I see a reference to using the scriptPath option?
Can you run it again, then try
http://localhost:3000/browser-sync/browser-sync-client.js
in a browser…