jop-software / astro-cookieconsent

Simple to use Cookie Consent for Astro
GNU General Public License v3.0
42 stars 3 forks source link

Consent modal doesn't display when deployed #7

Closed tylerdickerson closed 1 year ago

tylerdickerson commented 1 year ago

The consent modal only displays when running a local dev server with astro dev. When using astro build / astro preview or deploying to a live server (via GitHub push/Netlify) the modal isn't displayed, and manually invoking the Settings modal with a button has no effect.

I have these integrations enabled in astro.config.mjs:

cngJo commented 1 year ago

Hi!

Thanks for the report. I believe this is related to #2.

Please try adding

<script>
    import 'vanilla-cookieconsent/dist/cookieconsent.css';
</script>

to each page head Tag by e.g., adding it to the / a global layout.

I could reproduce your described behavior by removing said line from the layout in one of my pages.

Please let me know weather that fixes your issue or if you still have issues.

tylerdickerson commented 1 year ago

Hi cngJo,

Adding that script to a global layout fixed it - Thank you for the quick response and for building this very useful plugin.

Cheers

cngJo commented 1 year ago

Awesome, glad I could help and the plugin is helpful to you!