AleksandrRogov / DynamicsWebApi

DynamicsWebApi is a Microsoft Dataverse Web API helper library for JavaScript & TypeScript
MIT License
268 stars 58 forks source link

Bug: Object.hasOwn not supported in Node.js < 16.9.0 #160

Closed morganwynne closed 1 year ago

morganwynne commented 1 year ago

DynamicsWebApi version v2.0.0

Describe the bug The retrieve method, and possibly other methods, utilizes Object.hasOwn, which is only supported by Node.js v16.9.0 and later. Unfortunately, when attempting to use the retrieve method on Node.js v15.14.0, it leads to compatibility issues and unexpected errors.

Actual result

TypeError: Object.hasOwn is not a function
at _clearRequestData (C:\\Lumen\\TruSales\\node_modules\\dynamics-web-api\\dist\\cjs\\dynamics-web-api.js:1440:14)
at _runRequest (C:\\Lumen\\TruSales\\node_modules\\dynamics-web-api\\dist\\cjs\\dynamics-web-api.js:1452:5)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:94:5)

Your Setup (please complete the following information):

Additional context Thank you for your assistance in addressing this matter. Could you kindly provide information on the minimum version of Node.js that this package aims to support?

AleksandrRogov commented 1 year ago

hi @morganwynne , thank you for reporting this. I will release a patch as soon as possible. The minimum supported version for Node should be 15.0.

AleksandrRogov commented 1 year ago

Should be fixed in v2.0.1. Please let me know if you get any other issues related to v15. I would recommend updating to v16 though, because v15 is out of maintenance and not being supported by the core Node.js team anymore. Thanks