This problem arise if developer do not want to put fetch permission inside main.js
So what they need to do is to declare below code inside their main.js
//// Ensure window.Laravel.jsPermissions is defined with a default value
window.Laravel = window.Laravel || {};
window.Laravel.jsPermissions = window.Laravel.jsPermissions || { permissions: 0, roles: 0 };
This problem arise if developer do not want to put fetch permission inside main.js So what they need to do is to declare below code inside their main.js