orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
https://playground.cookieconsent.orestbida.com/
MIT License
3.91k stars 406 forks source link

[Bug]: CookieConsent v3 with Next.js #681

Closed combi-35 closed 5 months ago

combi-35 commented 5 months ago

Expected Behavior

How can we use v3 with Next.js? In the documentation I only read about React, when trying to use it the same way with next.js I got: TypeError: can't convert undefined to object

I was using v2 for the last 2 years with this setup mentioned here: #303 But I dont see initCookieConsent anymore, so I guess the setup has to be different for v3 with next.js.

Proposed fix or additional info.

No response

Version

3.0.1

On which browser do you see the issue?

Firefox, Chrome

judict commented 5 months ago

You don't need the old methods anymore. You can just use .run().

orestbida commented 5 months ago

@combi-35, v3 contains many breaking changes that makes it non compatible with v2.

You can find many demos here. Demo with Next.js 13