You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so i had this bug in my code, when my function didn't return object with traslations for ConsentModal. Which led to state._currentTranslation.consentModal be undefined and function createConsentModal did not create any html elements. This led to unrelated errors about missing dom elements. CookieConsent was trying add events and attributes even, when props like dom._cm where undefined.
Proposed solution
In createConsentModal should be atleast console.warn or throw?
constcreateConsentModal=(api,createMainContainer)=>{// .../** * @type {import("../global").ConsentModalOptions} */constconsentModalData=state._currentTranslation&&state._currentTranslation.consentModal;if(!consentModalData){// console.warn('consentModalData is undefined');// throw new Error('consentModalData is undefined');return;}// ...
Additional details
No response
The text was updated successfully, but these errors were encountered:
Description
Hello,
so i had this bug in my code, when my function didn't return object with traslations for ConsentModal. Which led to
state._currentTranslation.consentModal
be undefined and functioncreateConsentModal
did not create any html elements. This led to unrelated errors about missing dom elements. CookieConsent was trying add events and attributes even, when props likedom._cm
where undefined.Proposed solution
In
createConsentModal
should be atleastconsole.warn
or throw?Additional details
No response
The text was updated successfully, but these errors were encountered: