angular 4 + tedious connection error

90 views
Skip to first unread message

Kathy Steelandt

unread,
Jul 17, 2017, 1:31:37 PM7/17/17
to tedious
When initializing the connection I get a webpack error stating:

Module not found: Error: Can't resolve 'dns' in ...
same for 'dgram'

anyone knows how to resolve this?

used code:

import { OnInit } from '@angular/core';
import { Connection } from 'tedious';

const DBCONFIG = {
userName: 'myusr',
password: 'mypass',
server: 'myserver',
options: {
database: 'mydb',
tdsVersion: '7_1', // sql 2000
encrypt: false,
rowCollectionOnDone: true
}
};

export class DatabaseService implements OnInit {


ngOnInit() {
const DBconnection = new Connection(DBCONFIG);
}
}
Reply all
Reply to author
Forward
0 new messages