You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just installed dependency using yarn add tedious and yarn add @types/tedious , then tried to do simply connection, but looks like it's not possible cause I got following error:
Uncaught ReferenceError: require is not defined
at Object.events (index.js:140122)
at __webpack_require__ (index.js:790)
at fn (index.js:101)
at Object../node_modules/tedious/lib/bulk-load.js (index.js:99091)
at __webpack_require__ (index.js:790)
at fn (index.js:101)
at Object../node_modules/tedious/lib/tedious.js (index.js:110052)
at __webpack_require__ (index.js:790)
at fn (index.js:101)
at Module../src/app/database/sqlService.ts (index.js:139762)
looks like it comes from module.exports = require("events"); from tedious. There are a lot of answers in google about similar problems, that I should enable nodeIntegration. I don't think so thats it in this case, but anyway I've tried and it didn't work either.
Code:
export const connectToDb = (): Promise<Connection> => {
return new Promise((resolve, reject) => {
const config = {
authentication: {
options: {
userName: "sa", // update me
password: "" // update me
},
type: "default"
},
server: "test_gt_db@localhost", // update me
options: {
database: "test", //update me
encrypt: true
}
}
const connection = new Connection(config) // it breaks here
})
}
The text was updated successfully, but these errors were encountered:
looks like it comes from module.exports = require("events"); from tedious. There are a lot of answers in google about similar problems, that I should enable nodeIntegration. I don't think so thats it in this case, but anyway I've tried and it didn't work either.
Can you try the same process with following WebPreference configuration in main.ts file for Electron Window.
Hi!
Just installed dependency using
yarn add tedious
andyarn add @types/tedious
, then tried to do simply connection, but looks like it's not possible cause I got following error:looks like it comes from
module.exports = require("events");
fromtedious
. There are a lot of answers in google about similar problems, that I should enablenodeIntegration
. I don't think so thats it in this case, but anyway I've tried and it didn't work either.Code:
The text was updated successfully, but these errors were encountered: