tedious icon indicating copy to clipboard operation
tedious copied to clipboard

TypeError: The "config.options.textsize" property must be of type number or null.

Open charutiwari04 opened this issue 6 years ago • 5 comments

After installing version 5 of tedious/mssql, I am facing an issue while connecting to database. Following error is received, Looks like somewhere in your code config.options.textsize is set as string or something else, which should be either integer or null.

error: Error connecting database! {"timestamp":"2019-02-28T11:31:14-08:00"} TypeError: The "config.options.textsize" property must be of type number or null. at new Connection (/Users//node_modules/tedious/lib/connection.js:589:17) at base.Promise (/Users//node_modules/mssql/lib/tedious.js:237:23) at new Promise () at ConnectionPool._poolCreate (/Users//node_modules/mssql/lib/tedious.js:195:12) at ConnectionPool._connect (/Users//node_modules/mssql/lib/base.js:244:10) at ConnectionPool.connect (/Users//node_modules/mssql/lib/base.js:214:12)

Please refer to this issue for further details:

https://github.com/tediousjs/node-mssql/issues/799

charutiwari04 avatar Mar 01 '19 16:03 charutiwari04

Hi @charutiwari04, I just checked the code, I think the comment from the #799 looks correct. The default value for the textsize is actually set to a string. We will raise a bug on our side, and fix the issue. Thanks for raising this.

MichaelSun90 avatar Mar 08 '19 22:03 MichaelSun90

Hi @charutiwari04, thanks for raising this issue. I've clarified that the config.options.textsize is set by type string in the documentation .

IanChokS avatar Dec 13 '19 19:12 IanChokS

This still seems to be an issue in version 11.4.0. In connection.ts within the master branch src directory, I see textsize getting set to a string by default. Then, a validation check occurs on line 1643 that makes sure it's a number which fails. What version should I be using of mssql/tedious to avoid this issue? Thanks.

russell640 avatar Jul 28 '21 13:07 russell640

Hi @russell640, The textsize should be a string type like the documentation says. The validation check that occurs on line 1643 seems off. I will double-check this with @arthurschreiber, and we can create a PR for fixing this ASAP.

MichaelSun90 avatar Jul 29 '21 17:07 MichaelSun90

Hi @russell640, we just made PR #1309. You can take a look and see if this solves your problem. Also, we will make a fix for the documentation page as well.

MichaelSun90 avatar Aug 04 '21 20:08 MichaelSun90