I'm having an issue where I can't do any session/cookie based actions on the frontend through browser sync's proxy, I'm assuming it has to do with the domain name (localhost:3000 vs mysite.dev) is there any way around this?
I don't have any solution yet, but using proxyReq and proxyRes methods you can intercept every request and made necessary changes, so probably there is a way to "fake" a real store.
Interesting, it's weird because it seems like this was 'fixed':
There are some workarounds apparently but it didn't work for me:
you could try my solution, it solved
Failed to load resource: net::ERR_CONNECTION_REFUSED
problem, and enabled logging, adding to cart:
in browser-sync config:
inside `yourtheme/Magento_Theme/templates/html/browsersync.phtml`, paste:
<script id="__bs_script__">//<![CDATA[ document.write("<script async src='http://localhost:3000/browser-sync/browser-sync-client.js?v=2.18.8'><\/script>"); //]]> </script>
and extend `default_head_blocks.xml` with custom block pointing to the script above:
<referenceContainer name="before.body.end"> <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/browsersync.phtml" name="browserSync" /> </referenceContainer>
after running gulp, and entering to your local dev, browserSync should connect to the site, which should work with all functionalities.
Best regards, Adrian.