node-sqlserver-v8
node-sqlserver-v8 copied to clipboard
Unable to initialize msnodesql during Hot Module Reload (HMR)
Looking for help on resolving Unable to initialize msnodesql error during HMR, using vite for electron.
Source:
const msnodesqlv8 = require("mssql/msnodesqlv8");
Is there any reset or connection code I can apply to cause msnodesqlv8
to reload during HMR?
void Connection::Init(Local<Object> exports) {
Nan::HandleScope scope;
const auto initialized = OdbcConnection::InitializeEnvironment();
const auto name = Nan::New("Connection").ToLocalChecked();
if (!initialized) {
const nodeTypeFactory fact;
MutateJS::set_property_value(exports, name, Nan::Null());
fact.throwError("Unable to initialize msnodesql");
return;
}
Im sorry I am not aware how this can be solved. Can you try storing require on global and fetch back cached version is it related to second call to initialise. Ideally can you inject the same instance in every time. I’m really not an expert of the front end side of things.
@CarlosOnline did you find any solution for this? Please share of you have ideas =)