E
E
Evgeny Zhurov2020-01-22 00:48:31
JavaScript
Evgeny Zhurov, 2020-01-22 00:48:31

How to fix BX.Dexie is not a constructor error?

Good afternoon. Site on Bitrix. When loading the site in Firefox 72.0.2 browser (and possibly in any Firefox), the TypeError error pops up in the console: BX.Dexie is not a constructor. Swears specifically on this block of code

BX.frameCache.openDatabase = function()
  {

    var isDatabaseOpened = (this.cacheDataBase != null);

    if(!isDatabaseOpened)
    {
      this.cacheDataBase = new BX.Dexie("composite");
      if(this.cacheDataBase != null)
      {
        this.cacheDataBase.version(1).stores({
          composite: '&ID,CONTENT,HASH,PROPS'
        });
        isDatabaseOpened = true;
      }
    }

    return isDatabaseOpened;
  };

to the this.cacheDataBase line - always defined as null in all browsers. var BX = window.BX - this is how BX is defined at the very beginning of the file. But there is no Dexie object in it initially, and subsequently it does not seem to be set. The file containing this code is in /bitrix/js/main/core/core_frame_cache.js. As I understand it, these are some default Bitrix scripts that are better left untouched? So, it conflicts with some custom scripts, probably? Other browsers do not have this behavior. What could be causing this error and how to fix it? this.cacheDataBase = new BX.Dexie("composite");

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Harakhnin, 2020-01-24
@Chupokabr

Bitrix has implemented a UI module for interface components. This module includes the Dexie library
. It seems that we simply do not have the module installed in the system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question