tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.22k stars 464 forks source link

@azure/core-rest-pipeline breaking support for node.js 14 #1618

Closed dreaganluna closed 3 months ago

dreaganluna commented 3 months ago

Expected behaviour:

Installing version 9.x should work with node.js v14.x.

Actual behaviour:

After requiring the package in code, an error is thrown:

Error: Cannot find module 'node:os'
Require stack:
- C:\projects\someservice\node_modules\@azure\logger\dist\commonjs\log.js
- C:\projects\someservice\node_modules\@azure\logger\dist\commonjs\debug.js
- C:\projects\someservice\node_modules\@azure\logger\dist\commonjs\index.js
- C:\projects\someservice\node_modules\@azure\core-rest-pipeline\dist\commonjs\log.js
- C:\projects\someservice\node_modules\@azure\core-rest-pipeline\dist\commonjs\policies\logPolicy.js
- C:\projects\someservice\node_modules\@azure\core-rest-pipeline\dist\commonjs\createPipelineFromOptions.js
- C:\projects\someservice\node_modules\@azure\core-rest-pipeline\dist\commonjs\index.js
- C:\projects\someservice\node_modules\@azure\core-client\dist\commonjs\serviceClient.js
- C:\projects\someservice\node_modules\@azure\core-client\dist\commonjs\index.js
- C:\projects\someservice\node_modules\@azure\identity\dist\index.js
- C:\projects\someservice\node_modules\tedious\lib\connection.js
- C:\projects\someservice\node_modules\tedious\lib\tedious.js
- C:\projects\someservice\node_modules\mssql\lib\tedious\connection-pool.js
- C:\projects\someservice\node_modules\mssql\lib\tedious\index.js
- C:\projects\someservice\node_modules\mssql\index.js

I came across this issue in @azure/core-rest-pipeline that talks about breaking compatibility with node.js 14.x without increasing their major version number: https://github.com/Azure/azure-sdk-for-js/issues/28918

Software versions

dhensby commented 3 months ago

Unfortunately this isn't a package we control, so we can't make a fix to it - if dependencies break things it needs to be raised with the upstream package. Even more relevant is that it's a dependency of tedious and not this package, so we can't even hard pin to a version in our deps.

In the meantime you'll need to override the dependency resolution locally to keep it working.

dreaganluna commented 3 months ago

@dhensby, I get that, but at the same time, the mssql package can no longer state that 9.x supports node.js v14.x.