Frappe.boot is undefined

Hi everyone,
I’ve been dealing with this issue since I tried to implement an event listener in my custom app. As I load the main page (even without clicking on any button which may trigger the script) I get the following sequence of warnings and errors:

jQuery.Deferred exception: frappe.boot is undefined init@http://192… first and after that

Any idea on how to fix this? Thanks in advance!

Hi @Bradley
If we look at Frappe before customization, we don’t get that error. So i think it’s must something related to what you changed.
So can you share your code? Because i think you got an error syntax or something like that.

You’re right @antzforwork, before customization there was no error. It’s a template I’m using as a base template por my .html pages, so I made it work by adding the following script:

  frappe.boot = {
    sysdefaults: {
      float_precision: parseInt("3"),
      date_format: "dd-mm-yyyy",
  // for backward compatibility of some libs
  frappe.sys_defaults = frappe.boot.sysdefaults;

Followed by that, I included the following scripts, which were already added when it wasn’t running properly:

{{ include_script('libs.bundle.js') }}
{{ include_script('desk.bundle.js') }}
{{ include_script('list.bundle.js') }}
{{ include_script('form.bundle.js') }}
{{ include_script('controls.bundle.js') }}
{{ include_script('report.bundle.js') }}
{{ include_script('erpnext.bundle.js') }}

<script>frappe.csrf_token = "{{frappe.session.csrf_token}}";</script>

That way I solved the issue, although I’m still guessing what may have caused it at first.