alipay / alipay-sdk-nodejs-all

支付宝开放平台 Alipay SDK for Node.js
https://docs.open.alipay.com/54/103419/
Other
410 stars 65 forks source link

Error thrown from urllib breaks NodeJS when application making many http requests #146

Open jusfeel opened 3 months ago

jusfeel commented 3 months ago

Node: v20.14.0

└─┬ alipay-sdk@4.11.0 └── urllib@3.25.1

apps/dddd/node_modules/urllib/dist/commonjs/diagnosticsChannel.js:51
        Object.defineProperty(err, symbols_js_1.default.kErrorSocket, {
               ^

TypeError: Cannot redefine property: Symbol(socket of error)
    at Function.defineProperty (<anonymous>)
    at node_net_1.Socket.destroy (/apps/dddd/node_modules/urllib/dist/commonjs/diagnosticsChannel.js:51:16)
    at connectErrorNT (node:net:1527:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.14.0
[nodemon] app crashed - waiting for file changes before starting...

It seems the urllib library is trying to add a non-configurable property(a Symbol property) that already exists while my server side application running other http requests.

After I disabled alipay-sdk, the error disappeared.

I am not sure if it's urllib or alipay-sdk to blame.

Apologies if it's urllib problem.