voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.04k stars 287 forks source link

RangeError: Maximum call stack size exceeded #302

Open husmen73 opened 4 years ago

husmen73 commented 4 years ago

Ref: https://github.com/voltrue2/in-app-purchase/issues/247

Versions: node v10.15.3 pm2 v4.1.2 in-app-purchase ^1.11.4 request 2.88.0

Some of our users receipts could not validate their receipts. This error only occurs in Apple receipts.

What can cause this error?

Log: iapService.validate(receipt) onError: RangeError: Maximum call stack size exceeded 0|Server | at String.toString (<anonymous>) 0|Server | at isPlainObject (/var/www/vhosts/socket/node_modules/extend/index.js:17:20) 0|Server | at extend (/var/www/vhosts/socket/node_modules/extend/index.js:95:27) 0|Server | at extend (/var/www/vhosts/socket/node_modules/extend/index.js:104:51) 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:88:5 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12 0|Server | at /var/www/vhosts/socket/node_modules/request/index.js:100:12

husmen73 commented 4 years ago

Please check https://github.com/request/request/issues/2828

Bazm0 commented 4 years ago

Seeing the same issue occur, the underlying issue with the Request module appears to be related to reqeust.defaults. Suggest explicitly ensuring that requestDefaults is not included in the configuration object used in iap.config(config) This should avoid the issue.