[Bug]: The "Cookie banner" keeps appearing after every reload in the localhost server
The "Cookie banner" keeps appearing after every reload on the localhost server.
Expected behavior
The "Cookie banner" should not appear after every reload on the localhost server:
Actual behavior
It should work just like the preview URL.
Reproduction steps
- Activate the banner at
/settings/privacy/consent-banner - Clone Dawn using
shopify theme init - Run
shopify theme dev - Notice it keeps appearing after every refresh
The issue is not with the CLI but with the privacy banner itself. When a visitor tries to save their cookie preference by selecting either of the options, the cookie banner makes a POST request to https://127.0.0.1:9292/api/unstable/graphql.json.
Since the local dev server doesn't support SSL, the request fails and the user's preference is not saved.
As a workaround, you can prefix your local URL with ?pb=0 to keep the banner hidden.
Unfortunately that's not a sustainable solution - it's fine if you're only working on one page, but if you navigate around the store then the issue will continue.
Hi @ranjan-purbey @verdant-spark I work for the Privacy and Compliance team and we will take a look and check if it is possible to disable the banner in these local envs. Looks like the banner lib and the cookie are not working properly in local development env.
Thanks, @Truja. Any news yet? The banner keeps showing up and it is super annoying. Especially in mobile view one has to click accept/decline every time as it blocks the whole view. Additionally, the cookie banner reappears with every HMR reload, forcing repeated interactions even after previous acceptance/rejection.
@jo-ced I am going to add this issue to my next week things.
Temporary work-around listed here: https://community.shopify.dev/t/shopify-cookiebar-cannot-dismiss-pernamently-on-localdev-customizer/9479/5?u=ceri_waters
Any update on this @karreiro?
Temporary work-around listed here: https://community.shopify.dev/t/shopify-cookiebar-cannot-dismiss-pernamently-on-localdev-customizer/9479/5?u=ceri_waters
Thank you so much @ceri-waterscreative. Your code snippet solves the issue.
I'll post it below in case the link stops working:
In theme.liquid add:
{%- if theme.role == "development" or request.design_mode -%}
{% style %}
#shopify-pc__banner {
display:none!important;
}
{% endstyle %}
{%- endif -%}
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
This is still happening - please keep this issue open and solve it!
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
@Truja are you still to be looking at this? It's so super annoying.
I just did a test and looks like the problem is fixed: https://screenshot.click/07-46-p1c5t-l0oan.mp4
Please, let me know if you still notice it.
@Truja Nope, the issue is still there, as you can see here: https://github.com/user-attachments/assets/c6c53ba0-af3f-4b85-bfbb-e0c702b0c240
I'm running shopify theme dev using the current latest version (3.83.3)
@Truja - still present for me too. Also on 3.83.3
Oh, it is happening when you run the theme specifically ... Thanks @MassimilianoLattanzio @verdant-spark I will test later today
@MassimilianoLattanzio @verdant-spark Could you please retest ?? We merged a solution. Thanks
@Truja Not yet solved, unfortunately. https://github.com/user-attachments/assets/bb750c83-636c-4df8-beed-b1e4b2a7ab60
I'm using 3.84.0 version
happens to me too. Any news?
How is this not fixed yet? Very annoying.
Yep experiencing this (again)