Cookies-EU-banner icon indicating copy to clipboard operation
Cookies-EU-banner copied to clipboard

launchFunction is not a function

Open GeoffreyOlivier opened this issue 4 years ago • 3 comments

Hello, I have a error message window is not defined I don't why, I just install and add my script for the file in my nuxt.conf.js. I work with Nuxt JS

import CookiesEuBanner from 'cookies-eu-banner'
export default {
  new: CookiesEuBanner(function () {
    console.log('hello')
  }, true)
}

Sorry for the several edit.

GeoffreyOlivier avatar Sep 17 '20 08:09 GeoffreyOlivier

I have the same issue, but I think the title of this ticket is wrong...

paddotk avatar Dec 19 '22 13:12 paddotk

This lib is browser-side, not server-side, so it can't be server-side rendered. I do not know much about Nuxt or Next or things like that, but be sure ton put that code on client side only

Alex-D avatar Dec 19 '22 15:12 Alex-D

@Alex-D I'm also using Nuxt, but made sure to instantiate it client-side. window is available, yet CookiesEuBanner doesn't seem to recognize it (or give the wrong error perhaps).

paddotk avatar Jan 10 '23 10:01 paddotk