tinesoft / ngx-cookieconsent

Cookie :cookie: Consent module for Angular.
https://tinesoft.github.io/ngx-cookieconsent/
MIT License
162 stars 35 forks source link

Cookie popup not appearing in published website #128

Closed gregoryscode closed 1 year ago

gregoryscode commented 1 year ago

Ngx-CookieConsent Version

3.0.1

CookieConsent Version

3.1.1

Angular CLI (or Nx CLI) Version

13.1.4

Node Version

16.14.2

OS Version

Windows 10

Expected Behaviour

After publishing my website, the cookie popup should appear as it appears correctly in localhost.

Actual Behaviour

After publishing my website, the cookie popup doesn't appear. No errors in browser console.

It appears correctly in localhost.

I'm using environment variable to set the cookie domain. But even putting the address manually in the cookie consent config it doesn't work.

export const environment = {
  production: true,
  cookieDomain: 'mywebsite.com.br'
};
const cookieConfig: NgcCookieConsentConfig = {
  cookie: {
    domain: environment.cookieDomain
  },
  palette: {
    popup: {
      background: "#3f3f3f",
      text: "#ffffff",
      link: "#ffffff"
    },
    button: {
      background: "#299cff",
      text: "#ffffff",
      border: "transparent"
    }
  },
  position: 'bottom',
  theme: 'classic',
  type: 'info',
  content: {
    message: "Esse website utiliza cookies para garantir uma melhor experiência de navegação e funcionalidades.",
    dismiss: "Entendido",
    deny: "Rejeitar",
    link: "Saiba mais",
    href: "https://cookiesandyou.com",
    policy: "Política de Cookies"
  }
};
  imports: [
    ...
    NgcCookieConsentModule.forRoot(cookieConfig)
  ],

Steps to reproduce the behaviour

  1. Install ngx-cookieconsent in same version;
  2. Add environment variable to control the cookie domain;
  3. Publish website.
gregoryscode commented 1 year ago

I'm using Brave browser, which disables the cookie consent popup. Sorry about the inconvenience.