Skip to content

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

Open

Description

@charutiwari04

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:

tediousjs/node-mssql#799

Activity

  1. MichaelSun90 commented on Mar 8, 2019

    @MichaelSun90
    Contributor

    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.

  2. IanChokS commented on Dec 13, 2019

    @IanChokS
    Member

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

  3. russell640 commented on Jul 28, 2021

    @russell640

    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.

  4. MichaelSun90 commented on Jul 29, 2021

    @MichaelSun90
    Contributor

    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.

  5. MichaelSun90 commented on Aug 4, 2021

    @MichaelSun90
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions