Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'cookie') #18

Open
shi-rudo opened this issue Feb 8, 2024 · 3 comments

Comments

@shi-rudo
Copy link

shi-rudo commented Feb 8, 2024

After just doing

pnpm astro add @jop-software/astro-cookieconsent

with

"astro": "^4.3.5" 
"@jop-software/astro-cookieconsent": "^3.0.0",

I get

vanilla-cookieconsent.js?v=a4bf547f:720 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'cookie')
    at vanilla-cookieconsent.js?v=a4bf547f:720:101
    at Module.Xe (vanilla-cookieconsent.js?v=a4bf547f:753:7)
    at page.js:2:15
(anonymous) @ vanilla-cookieconsent.js?v=a4bf547f:720
Xe @ vanilla-cookieconsent.js?v=a4bf547f:753
(anonymous) @ page.js:2

example repo: https://github.com/shi-rudo/faithful-fusion

what do I miss? the README doesn't provide any further information.

@SerkanSipahi
Copy link

SerkanSipahi commented Feb 19, 2024

@shi-rudo I can confirm this issue. What I am missing?

cookieconsent({
    guiOptions: {
        consentModal: {
            layout: 'cloud',
            position: 'bottom center',
            equalWeightButtons: true,
            flipButtons: false
        },
        preferencesModal: {
            layout: 'box',
            position: 'right',
            equalWeightButtons: true,
            flipButtons: false
        }
    }
}

@SerkanSipahi
Copy link

@shi-rudo I found and could solve the error. The error happens because of a missing configuration. Please see https://cookieconsent.orestbida.com/essential/getting-started.html#configuration or download a setting here https://playground.cookieconsent.orestbida.com/

@marcitqualab
Copy link

I am adding PR #22 with my fix to add the required properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants