TypeError: The "config.options.textsize" property must be of type number or null.
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
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.
Hi @charutiwari04, thanks for raising this issue. I've clarified that the config.options.textsize is set by type string in the documentation .
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.
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.
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.