I updated succesfully to following version: openHAB 5.1.3 Release Build, Main UI Commit f18caf73
Unfortunately the problem still occures.
I now saw, that there is an AI helper tool in the Chrome console. Maybe this explanation helps…
Chrome AI console feedback
Error message:
index-Buyt_kkZ.js:1070 TypeError: this.getLastVariableKeyValue is not a function
at Proxy.value (index-Buyt_kkZ.js:43574:25)
at nt (index-Buyt_kkZ.js:372:19)
at get value (index-Buyt_kkZ.js:930:14)
at Object.get [as value] (index-Buyt_kkZ.js:1658:23)
at index-Buyt_kkZ.js:43716:110
at r2 (index-Buyt_kkZ.js:1148:14)
at R (index-Buyt_kkZ.js:1559:23)
at index-Buyt_kkZ.js:16339:9
at r2 (index-Buyt_kkZ.js:1148:14)
at Ga (index-Buyt_kkZ.js:2708:47)
Explanation
Understanding the problem
The TypeError: this.getLastVariableKeyValue is not a function indicates that the code is attempting to call a method named getLastVariableKeyValue on an object referred to by this, but this object does not have such a method. This typically happens for one of two main reasons:
-
Incorrect this context: In JavaScript, the value of this is determined by how a function is called. If the function containing the call to this.getLastVariableKeyValue is not executed in the context of an object that does have this method, this will refer to something else (e.g., the global object in non-strict mode, undefined in strict mode, or another object entirely), leading to the error.
-
Method is not defined: The getLastVariableKeyValue method might simply not exist on the object it’s supposed to. This could be due to a typo in the method name, the method not being properly defined or imported, or the object being instantiated without the necessary method.
Given the stack trace points to Proxy.value (index-Buyt_kkZ.js:43574:25), it suggests this is likely happening within a component or module where this is expected to refer to the component instance or a specific class instance that should contain this method. The minified file index-Buyt_kkZ.js indicates a bundled application, making it harder to pinpoint the exact original source without debugging.
How to verify
To verify the cause, you can set a breakpoint at the line indicated in the error: index-Buyt_kkZ.js:43574:25. When the execution pauses at this breakpoint:
This will help determine if this is the wrong object or if the method is simply missing from the expected object.
Suggested fix
The most common fixes involve ensuring the correct this context or defining the missing method:
1. Correcting this context
If this is incorrect, you might need to bind the function or use an arrow function:
a) Using bind(): If the function where this.getLastVariableKeyValue is called is passed as a callback, explicitly bind this to the correct context:
// Original (problematic)
someObject.doSomething(this.myFunction);
// Fix: Bind 'this'
someObject.doSomething(this.myFunction.bind(this));
b) Using an arrow function: Arrow functions lexically bind this, meaning this will refer to the this of the enclosing scope. If your problematic function is a method within a class or object, an arrow function can preserve the this context:
class MyClass {
constructor() {
this.value = 'example';
}
getLastVariableKeyValue() {
return this.value;
}
// Original (problematic if not called directly on MyClass instance)
// myMethod() {
// console.log(this.getLastVariableKeyValue());
// }
// Fix: Use an arrow function for methods that might lose 'this' context
myMethod = () => {
console.log(this.getLastVariableKeyValue());
}
}
2. Defining the missing method
If getLastVariableKeyValue is genuinely missing from the object, ensure it is properly defined:
-
Check for typos: Double-check the method name for any spelling mistakes.
-
Verify object instantiation: Ensure the object is instantiated from a class or object literal that includes getLastVariableKeyValue.
-
Mixin/inheritance: If the method is expected from a mixin or inherited class, ensure the inheritance chain or mixin application is correct.
Since the provided code snippet is a utility function In and not directly related to this.getLastVariableKeyValue, the issue lies in the code calling In or further up the call stack, specifically at index-Buyt_kkZ.js:43574:25. You’ll need to examine the source code around that line in the unminified version (if available) or debug using the browser’s developer tools.
Summary
The TypeError: this.getLastVariableKeyValue is not a function means the object referred to by this does not possess the getLastVariableKeyValue method. This usually stems from an incorrect this context in the function call or the method simply not being defined on the object. Verify by inspecting this at the breakpoint, and fix by ensuring this is correctly bound or by defining the method where expected.
Console message
TypeError: this.getLastVariableKeyValue is not a function
at Proxy.value (index-Buyt_kkZ.js:43574:25)
at nt (index-Buyt_kkZ.js:372:19)
at get value (index-Buyt_kkZ.js:930:14)
at Object.get [as value] (index-Buyt_kkZ.js:1658:23)
at index-Buyt_kkZ.js:43716:110
at r2 (index-Buyt_kkZ.js:1148:14)
at R (index-Buyt_kkZ.js:1559:23)
at index-Buyt_kkZ.js:16339:9
at r2 (index-Buyt_kkZ.js:1148:14)
at Ga (index-Buyt_kkZ.js:2708:47)
Stacktrace
In @ index-Buyt_kkZ.js:1070
Fn @ index-Buyt_kkZ.js:1066
ga @ index-Buyt_kkZ.js:2508
s3 @ index-Buyt_kkZ.js:2181
run @ index-Buyt_kkZ.js:295
re2 @ index-Buyt_kkZ.js:2195
ne2 @ index-Buyt_kkZ.js:2147
A2 @ index-Buyt_kkZ.js:2139
h2 @ index-Buyt_kkZ.js:2057
s3 @ index-Buyt_kkZ.js:2182
run @ index-Buyt_kkZ.js:295
re2 @ index-Buyt_kkZ.js:2195
ne2 @ index-Buyt_kkZ.js:2147
A2 @ index-Buyt_kkZ.js:2139
h2 @ index-Buyt_kkZ.js:2057
D2 @ index-Buyt_kkZ.js:2101
te2 @ index-Buyt_kkZ.js:2137
h2 @ index-Buyt_kkZ.js:2054
D2 @ index-Buyt_kkZ.js:2101
te2 @ index-Buyt_kkZ.js:2137
h2 @ index-Buyt_kkZ.js:2054
D2 @ index-Buyt_kkZ.js:2101
T2 @ index-Buyt_kkZ.js:2082
w2 @ index-Buyt_kkZ.js:2079
h2 @ index-Buyt_kkZ.js:2057
s3 @ index-Buyt_kkZ.js:2182
run @ index-Buyt_kkZ.js:295
re2 @ index-Buyt_kkZ.js:2195
ne2 @ index-Buyt_kkZ.js:2147
A2 @ index-Buyt_kkZ.js:2139
h2 @ index-Buyt_kkZ.js:2057
D2 @ index-Buyt_kkZ.js:2101
te2 @ index-Buyt_kkZ.js:2137
h2 @ index-Buyt_kkZ.js:2054
D2 @ index-Buyt_kkZ.js:2101
te2 @
Related code
function In(e2, t2, n2, r2=true, i2=false) {
if (i2)
throw e2;
console.error(e2);
}
var Ln = []
, Rn = -1
, zn = []
, Bn = null
, Vn = 0
, Hn = Promise.resolve()
, Un = null;
Wn = function(e2) {
let t2 = Un || Hn;
return e2 ? t2.then(this ? e2.bind(this) : e2) : t2;
}
;