beyonk-group / gdpr-cookie-consent-banner

A GDPR compliant cookie consent banner implementation
MIT License
248 stars 42 forks source link

gdpr-cookie-consent-banner with SvelteKit #25

Closed zofiaifoz closed 2 years ago

zofiaifoz commented 2 years ago

Does the consent banner work with Sveltekit? I tried to implement it but I get this error:

SyntaxError: The requested module '/node_modules/@beyonk/gdpr-cookie-consent-banner/src/util.js' does not provide an export named 'validate'

antony commented 2 years ago

I've not tried it to be honest. It's written in CJS so it probably needs to be converted to ESM.

zofiaifoz commented 2 years ago

OK @antony I'll see what I can do. thx.

james-camilleri commented 2 years ago

I'm also trying to get this working on SvelteKit. Would you be interested in a PR if we could get it to play nice @antony?

antony commented 2 years ago

Hey @jcamilleri13 - We'd absolutely love a PR!

james-camilleri commented 2 years ago

Ok, I think I've got it working - #28. I've tested it on my own SvelteKit project and it works nicely. There's been a minor change to the exported bundles, but I think it might be because I compiled them with a different minor Svelte version. Nothing seems drastic enough to affect functionality.

The cookie-universal dependency isn't ESM-compatible yet, so that will also need to be updated, but I've included information on a workaround in the README.

antony commented 2 years ago

Resolved by https://github.com/beyonk-adventures/gdpr-cookie-consent-banner/pull/28

thanks! :partying_face: