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
I wanted to use environment variables for the port option
What is actually happening?
I am having to use parseInt() to convert a string to a number
No overload matches this call.
Overload 1 of 4, '(options?: Options): Sequelize', gave the following error.
Type 'string' is not assignable to type 'number'.
Overload 2 of 4, '(uri: string, options?: Options): Sequelize', gave the following error.
Argument of type '{ port: string; }' is not assignable to parameter of type 'string'.ts(2769)
sequelize.d.ts(239, 3): The expected type comes from property 'port' which is declared here on type 'Options'
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
Issue Description
The port option should accept both strings and numbers. The NodeJS URL
API defines port as a string, where this value ultimately ends up.
It should not be necessary to
parseInt(process.env.PORT)
, for example.What are you doing?
I am trying to create an instance of
Sequelize
, configuring the port for the connection using an environment variableprocess.env.PORT
.What do you expect to happen?
I wanted to use environment variables for the port option
What is actually happening?
I am having to use parseInt() to convert a string to a number
Additional context
Environment
Issue Template Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
I have created draft pull request #13024, I do not have time to carry it further.
The text was updated successfully, but these errors were encountered: