segmentio/consent-manager

Cannot read properties of undefined (reading 'initialized'), at conditionallyLoadAnalytics

Closed this issue · 4 comments

Getting this error on lots of devices, some devices/accounts seem to be okay

Hi @devmin222 could you help us to explain more about the issue?
In which moment show you that error?
Which version of consent-manager are you using?
and what is the framework that you using on your project?

Hey @edsonjab, so I'm getting this error when trying to open the segment consent manager by clicking on the website data collection preferences button.
The application is built on React with vite and typescript.
Following are the segment packages that's being currently used;
    "@analytics/segment": "^1.1.4",
    "@segment/analytics-next": "^1.51.3",
    "@segment/analytics-react": "^1.0.0-rc1",
    "@segment/consent-manager": "^5.7.0",
    "@segment/in-eu": "^0.4.0",
    "@types/segment-analytics": "^0.0.34",

Hi @devmin222 that happens when the app did not have the script on header HTML

you can check this example on NextJS (this example is similar to Vite)

https://github.com/segmentio/consent-manager#example-in-nextjs

like the section <script>

Thanks, that seems to be working