Cannot find module 'casper' with 1.1 beta - phantomjs

This command was working:
/usr/local/Cellar/casperjs/1.0.2/libexec/bin/casperjs myfile.coffee
Now I want to use 1.1 like so:
/usr/local/Cellar/casperjs/1.1-beta3/libexec/bin/casperjs myfile.coffee
But now I get this error:
Error: Cannot find module 'casper'
phantomjs://bootstrap.js:289
phantomjs://bootstrap.js:254 in require
People reporting this error are trying to invoke casper by running phantomjs, but as you see I am running casperjs directly. What gives?
UPDATE
In case it provides a clue, when I call require = patchRequire(require) on the first line of my script, I get this error:
TypeError: 'undefined' is not an object (evaluating 'require.patched')
/usr/local/Cellar/casperjs/1.1-beta3/libexec/bin/bootstrap.js:197 in patchRequire

Related

TypeError: userAgent.toLowerCase is not a function

While running Angular-unit test, using chrome browser, ended up with the error as
TypeError: userAgent.toLowerCase is not a function
at _isAndroid (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/forms/fesm2015/forms.mjs:176:43)
at new DefaultValueAccessor (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/forms/fesm2015/forms.mjs:227:38)
at NodeInjectorFactory.factory (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/forms/fesm2015/forms.mjs:254:1)
at getNodeInjectable (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/core/fesm2015/core.mjs:3565:44)
at instantiateAllDirectives (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/core/fesm2015/core.mjs:10318:27)
at createDirectivesInstances (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/core/fesm2015/core.mjs:9647:5)
at ɵɵelementStart (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/core/fesm2015/core.mjs:14561:9)
at templateFn (ng:///TodaysMarketMoversComponent.js:397:66)
at executeTemplate (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/core/fesm2015/core.mjs:9618:9)
at renderView (http://localhost:9876/_karma_webpack_/webpack:/node_modules/#angular/core/fesm2015/core.mjs:9421:13)
Most wondering/confusing part to me- toLowerCase function has never been used through out the component/spec file.
It looks like the userAgent is being checked by the #angular/forms lib and has been deleted or not provided at all for some reason.
If it's not your code that's changing the userAgent then it's probably some third-party script.
If I were you I'd start with the latest additions in terms of libraries and dependencies and peel them back until I get a unit test running. That will give the clue.

Not able to register 'FigureCanvasQtQuickAgg' in qml file using qmlRegisterType

I am trying to embed a matplotlib plot in my qml window. Following the example given in this link There are 2 points:
When I try to use QtQml.qmlRegisterType from matplotlib_backend_qtquick and rest from PySide6, I get error as module 'Backend' not installed.
When I try to use QtQml.qmlRegisterType from PySide6, I get following error
qmlRegisterType(FigureCanvasQtQuickAgg, "Backend", 1, 0, "FigureCanvas")
TypeError: A type inherited from PySide6.QtCore.QObject expected, got FigureCanvasQtQuickAgg.
How do I resolve these errors?

ModalDirective causing error in Angular Universal

I have a ModalDirective from ngx-bootstrap version 1.9.3 and am using Angular 4. When a call is made to show() when code is executing on the server side (I am using Angular Universal), I am getting the following exception:
Cannot read property 'body' of undefined
TypeError: Cannot read property 'body' of undefined
at ModalDirective.checkScrollbar (ClientApp\dist\main-server.js:49156:105)
at ModalDirective.show (ClientApp\dist\main-server.js:48977:14)
at ConfirmModalComponent.show (ClientApp\dist\main-server.js:48086:27)
at SafeSubscriber._error (ClientApp\dist\main-server.js:87270:41)
at SafeSubscriber.module.exports.SafeSubscriber.__tryOrUnsub (ClientApp\dist\vendor.js:574:16)
at SafeSubscriber.module.exports.SafeSubscriber.error (ClientApp\dist\vendor.js:533:26)
at Subscriber.module.exports.Subscriber._error (ClientApp\dist\vendor.js:464:26)
at Subscriber.module.exports.Subscriber.error (ClientApp\dist\vendor.js:438:18)
at MapSubscriber.module.exports.Subscriber._error (ClientApp\dist\vendor.js:464:26)
at MapSubscriber.module.exports.Subscriber.error (ClientApp\dist\vendor.js:438:18)
Is the code not built to support Angular Universal or is there something I need to do in order to get this working?
Please update ngx-bootstrap to 2.0.0-beta.8, it supports Angular Universal.

lua code fails on require statement

Problem Description
I have some code that I've inherited and I'm trying to debug. It's a web application that is written in lua for the back end.
The system fails right now with an error that says the following:
398: attempt to call global 'require' (a nil value)
Code
Line 398 is the require statement you see below..
getstatus = function()
require("processinfo")
local value,errtxt=processinfo.package_version(packagename)
etc...
What I've tried so far:
I've tried to test to make sure that the package / module it's looking for exists. It does. It's in my lua lib folder
test-dev:/usr/share# find / -name processinfo*
/usr/share/lua/5.1/processinfo.lua
I've also launched the lua command line and tried to include the module, like so:
test-dev:/usr/share# lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
require("processinfo")
And it seems to be happy, no error messages.
Finally, I've tried to move the require statement from line 398 to the top of the file with the rest of the include statements that I have ... like so:
module(..., package.seeall)
posix = require("posix")
utils = require("utils")
processinfo = require("processinfo")
When I do that, the error message about the require statement goes away but instead i get an error about the string function I'm calling. The error message is :
139: attempt to index global 'string' (a nil value)
Line 139 is the opening of a while loop that looks like this:
while string.find(result, "%$[%w_]+") do
-- do something
end
Additional Information
Lua version is 5.1
this code is working on another server...

Append database record in HTML5 builder fatal error

I have some code in my application:
$dmMain->tblOrgList->append();
This code written with auto-completion, so everything is correct.
But, when I trying to execute this code, I have error:
Fatal error: Call to a member function append() on a non-object in
C:\Users\ASAP\Documents\HTML5 Builder\Projects\VitoOrgList\index.php
on line 18
Can somebody advice, where I can find a trouble?
Thanks
I found the solution.
Really, I have no big PHP experience :-]
I just added before calling $dmMain methods in function body:
global $dmMain;