CasperJS screenshot comes as blank after selecting a link - dojo

Using casperJS script, after successful login into application, and clicking on a link, following error is thrown and web page comes as blank:
ERROR: TypeError: 'undefined' is not a function (evaluating
'g.getItem.bind(g)')
TRACE:
-> scripts/dojo/dojo/dojo.js: 20
ERROR: TypeError: 'undefined' is not a function (evaluating
'g.getItem.bind(g)')
The application is build on top of dojo.

You’ve written some code that tries to use Function.prototype.bind. Function.prototype.bind doesn’t exist in PhantomJS. You need to change your code to use dojo/_base/lang.hitch instead.

Related

Odoo v15 LiveChat App will not load properly

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:
Opened the LiveChat channel (LiveChat App > Channels) and added myself as an Operator.
Copied the code snippet from the "Widget" tab (inside the LiveChat channel) and pasted it into the <head> of my website.
Clicked on the "Go To Website" button in the top right corner of the LiveChat Channel, and then clicked on the "Unpublished" button at the top right of the screen (which changed to "Published".)
Went into the "Settings" (Settings > Website > Features > Live Chat) and chose the channel from the dropdown.
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.

Inline worker is not supported

I am new to Vue.js and originally to testing.
so I am trying to write test for my component but this error occurs and I don't know were this error raises from and how to resolve it.
console error image
and this is the test code that I'm trying to execute.
test file

How to use the SDK without the dependency on a main video

I am trying to put an ad without the need to put a video,
I tried to remove the video in the function and in the html view, but I get this error:
TypeError: Cannot read properties of undefined (reading 'init')
Code
adsManager.init(640, 360, google.ima.ViewMode.NORMAL);

Can't display an alert using MessageBox in Sencha Touch 2

In a handler in one of my controllers, I'm running into issues displaying a simple alert message. Using Sencha Touch 2.4.1
Ext.Msg.alert('Status', 'test');
--> "Uncaught TypeError: Cannot read property 'alert' of undefined"
As per these instructions, I added the following require statement: Ext.window.MessageBox to my controller.
--> Failed to find any files for /PATH/FILE.js::ClassRequire::Ext.window.MessageBox
Replaced Msg with MessageBox and removed require statement.
Ext.MessageBox.alert('Status', 'test')
--> "Uncaught TypeError: undefined is not a function"
Ran into the same problem when using .confirm.
Here's the docs - looks like it should work.
Anybody know why it doesn't?
I needed to require Ext.MessageBox instead of Ext.window.MessageBox and had to use Ext.Msg.alert... instead of Ext.MessageBox.alert... though I'm not totally clear on why.
Saw this in the docs: "The framework provides a global singleton Ext.Msg for common usage which you should use in most cases."

vjs_pause function does not exists in swf mode

With video.js 4.0.3, I got this error when using the flash mode :
Uncaught exception: TypeError: 'this.el_.vjs_pause' is not a function
Error thrown at line 2772
No problem with HTML5 mode.
The pause function seems to be unavailable in the flash object
I ran into this same JS error few days back. The fix that worked for me was to first check if the video element or it's parent is visible or not. Only when it's visible, trigger the pause method.
Hope this helps!