I have a website built on Odoo v15 Enterprise Edition (SaaS, hosted by Odoo) and I would like to activate the LiveChat feature of the website. I created a sandbox to work in so I do not affect the live website.
I followed the instructions from the Odoo Documentation and did the following:
<head>
of my website.When I go to the homepage of my website I do not see a chat button and when I open the Console in Developer Tools (Chrome browser) I see these error messages:
Plain Text:
web.assets_common_minimal.min.js:85 warning: Some modules could not be started
web.assets_common_minimal.min.js:85 Missing dependencies: (3) ['web.Session', 'root.widget', 'im_livechat.legacy.im_livechat.im_livechat']
web.assets_common_minimal.min.js:90 Non loaded modules: (2) ['web.session', 'im_livechat.livesupport']
web.assets_common_minimal.min.js:91 Debug: {web.session: {…}, im_livechat.livesupport: {…}}
web.assets_common_minimal.min.js:78 Uncaught Error: Service web.session already defined
at odoo.define (web.assets_common_minimal.min.js:78:29)
at web.assets_frontend_lazy.min.js:1594:6
It looks like web.session
has already been defined. When I located the .xml file that contained the code for this (im_livechat.loader
), I found it contained the following:
<t t-if="web_session_required">
odoo.define('web.session', function (require) {
var Session = require('web.Session');
var modules = odoo._modules;
return new Session(undefined, "<t t-esc="info['server_url']"/>", {modules:modules, use_cors: true});
});
</t>
Just to see what would happen, I commented out this section of the im_livechat.loader
file and reloaded the homepage. The button was now visible, but was clearly not showing up the way it should be:
I also saw an error pop up (URL has been removed):
UncaughtPromiseError > TypeError
Uncaught Promise > Cannot read properties of undefined (reading 'bus_service')
TypeError: Cannot read properties of undefined (reading 'bus_service')
at ComponentAdapter._trigger_up (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:1565:32)
at Class._trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:462)
at Class._trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:462)
at Class.trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:280)
at Class.call (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4781:372)
at Class.start (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:2264:6)
at prototype.<computed> (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4581:488)
at Class.start (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:2346:77)
at Class.start (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4584:371)
at https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4929:52
When I check the Console in Developer Tools I see this error:
Plain Text:
web.assets_frontend_lazy.min.js:1565 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bus_service')
at ComponentAdapter._trigger_up (web.assets_frontend_lazy.min.js:1565:32)
at Class._trigger_up (web.assets_common_lazy.min.js:4728:462)
at Class._trigger_up (web.assets_common_lazy.min.js:4728:462)
at Class.trigger_up (web.assets_common_lazy.min.js:4728:280)
at Class.call (web.assets_common_lazy.min.js:4781:372)
at Class.start (web.assets_frontend_lazy.min.js:2264:6)
at prototype.<computed> (web.assets_common_lazy.min.js:4581:488)
at Class.start (web.assets_frontend_lazy.min.js:2346:77)
at Class.start (web.assets_common_lazy.min.js:4584:371)
at web.assets_common_lazy.min.js:4929:52
Can anyone point me in the right direction? Any help would be greatly appreciated.
Thank you!
We did end up solving this issue.
Apparently there was an older view (named "Livechat: include loader on Website") which was deactivated, but still causing issues with the way the code for the chat button was being loaded. We think it was an older view from a previous version of Odoo (we are currently running v15.)
After deleting the deactivated view the chat window began showing up correctly and everything worked as expected.