microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
324 stars 141 forks source link

Dependency issues for NodeJS v8 support #1121

Closed FrederikFrederiksenMancofi closed 1 year ago

FrederikFrederiksenMancofi commented 1 year ago

With the release of a new @azure/core-rest-pipeline v1.10.3 and its dependence on @azure/core-util v.1.3.0 I'm experiencing issues in my NodeJS v8.9.0 environment. The new version of core-util utilizes globalThis, which came with the release of node 12, and it results in the following error:

const uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function"
                     ^
ReferenceError: globalThis is not defined
rasmusskovdk commented 1 year ago

Perhaps this could be fixed by locking @azure/core-rest-pipeline and its dependence on @azure/core-util, but I guess such a fix would only be temporary unless backwards compatibility is a high priority of this project.

It would be nice though if package version references in package lock were a bit more ~ and a little less ^

tevoinea commented 1 year ago

I hit this issue as well on Node 10.

HesselWellema commented 1 year ago

Same issue. According to azure console the version is v14.20.0 (node -ver) WEBSITE_NODE_DEFAULT_VERSION = 14.15.0

JamieMagee commented 1 year ago

Locking @azure/core-util to 1.2.0 using npm overrides is a workaround for us.

hectorhdzg commented 1 year ago

Locking down the dependency version for now, we will look into removing this dependency entirely if possible, will be releasing a new version of this package later today.