Closed maku closed 2 years ago
@cjbj I do not understand. When I remove the import of "initOracleClient" I am not able to compile the typescript code....
You could help us by:
@maku never mind; I just spent some Saturday time and reproduced it. @anthony-tuininga supplied a patch that resolves it for us.
--- a/lib/oracledb.js
+++ b/lib/oracledb.js
@@ -105,6 +105,7 @@ class OracleDb {
this.createPool = nodbUtil.callbackify(createPool).bind(_oracledb);
this.shutdown = nodbUtil.callbackify(shutdown).bind(_oracledb);
this.startup = nodbUtil.callbackify(startup).bind(_oracledb);
+ this.initOracleClient = this.initOracleClient.bind(_oracledb);
}
// temporary method for determining if an object is a date until
Try putting that in a .patch file installed via a postInstall script in your package.json, see https://github.com/oracle/node-oracledb/issues/1391#issuecomment-884568248.
Thanks for reporting the issue.
Closing the issue. The fix was in the node-oracledb 5.4 release from back in June. Thanks for reporting it.
Give your database version: Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 - Production
Also run Node.js and show the output of:
Is it an error or a hang or a crash?
error
What error(s) or behavior you are seeing?
oracledb.js -> function initOracleClient -> Line 144 this is undefined
Uncaught TypeError: Cannot read properties of undefined (reading '_initOracleClient')
The same functionality works with typescript <= 4.3.x, with typescript >= 4.4 I get the error
example typescript code: