[Question] Support older version of nodejs
swamy2712 opened this issue · 2 comments
System Environment
- OS: Ubuntu
- NodeJS Version: 10.x
- This LIbrary Version:2.21.0
Question Description
Due to the recent implementation change for native fetch support for polyfill, can't use latest version of OData Client
Due to this commit, I'm not able to use latest version of Odata client since I get globalThis is undefined error on older version of nodejs (10.x version). Due to certain reasons we need to use older version of nodejs. Is there any possibility to change the referred implementation to check if globalfetch is undefined or not. Something like below would work I believe:
if (globalThis == undefined || globalThis.fetch === undefined) { global.fetch = require("fetch-cookie")(require("node-fetch")); }
sure, from my side, strongly suggest you upgraded to latest nodejs version -> avoid vulnerabilities of nodejs runtime, for security right ?
will try to improve and provide a patch version -> globalThis
not applicable for node v10
@odata/client@2.21.8
will use global
again, seems it will not be deprecated.