-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Cannot read property 'palette' of null #75
Comments
Hi @Kenji94 , I've just tested with your config on latest version of Angular (v9.1.0) and never encountered this error... I'm afraid there is not much i can do at this point... Why do you need to call |
It happens very rarely that's why it is difficult to find the origin of the problem. private updateCookiePopupLanguage() {
} |
I also regularly encounter this error in my Angular 9 application. It happens occasionally when I suspect it happens because the destroy() call tries to access the options object, which might not yet have been initialized in the view. A null check would probably fix it. |
Some further investigation tells me that the https://github.com/osano/cookieconsent dependency might be the problem. |
Hi,
Thank you for your lib!
Bug Report or Feature Request (mark with an
x
)OS Version?
browser Chrome Mobile 77.0.3865
Angular, Node and al Versions?
angular 9
Repro steps
Bug: 'Cannot read property 'palette' of null'
Cannot reproduce locally but is happening for some user on prod
This is happening either when:
this.ccService.destroy(); high chance this is happening on this line
or
this.ccService.init(this.ccService.getConfig()); low chance it is happening on this line
The log given by the failure
Node.removeChild(s),e.customStyles[n]=null}}}(this.options.palette),this.options=null},o.prototype.open=function(t){if(this.element)return t {snip}
Desired functionality
No crash
Mention any other details that might be useful
in my setup i have:
const cookieConfig: NgcCookieConsentConfig = {
cookie: {
domain: environment.domain
},
palette: {
popup: {
background: '#012E4B'
},
button: {
background: '#33B4A5'
}
},
theme: 'edgeless'
};
The text was updated successfully, but these errors were encountered: