I'm having trouble using the standard "require" statement when importing a module from another package in my VS Code extension, targeting Azure Data Studio. I am currently making the call at the beginning of the "activate" function, no other logic before.
I do get a nice error message:
"Error: A dynamic link library (DLL) initialization routine failed."
The module I'm trying to import is from JDBC, I'm obviously failing to load the required library, but I do not understand why.
I'm thinking the issue might be.
Something is not exported (included) in the extension output, so when new instance of Azure Data Studio starts, some dependency is missing.
Importing a dynamic link library is not allowed/possible inside the "activate" function, which purpose really is to interact with the Extension Context and/or other functionality provided by the VS Code API. Not sure why that would be though.
I'm really hoping it's closer to (1).
I've created a simple console application, installed the same package and running the same code, and it works. This is why I hope and believe that this is a packaging issue, something missing when the extension is installed.
try {
var jinst = require('jdbc/lib/jinst'); // <-- This fails when activating the extention
if (!jinst.isJvmCreated()) {
//Setup stuff..
}
}
catch (error) {
console.error(error);
}
My dependencies (package.json).
"dependencies": {
"java": "^0.11.0",
"jdbc": "^0.6.3"
}