Skip to content

Commit

Permalink
Work around node SDK tsc failure (#8681)
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Jan 4, 2022
1 parent b0cc9cb commit 08df93f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sdk/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/js-yaml": "^3.12.5",
"@types/minimist": "^1.2.0",
"@types/mocha": "^2.2.42",
"@types/node": "^12.0.0",
"@types/node": "14.18.3",
"@types/normalize-package-data": "^2.4.0",
"@types/read-package-tree": "^5.2.0",
"@types/semver": "^5.5.0",
Expand All @@ -50,5 +50,8 @@
},
"mocha": {
"require": ["ts-node/register", "source-map-support/register"]
}
},
"//": [
"NOTE: @types/node is pinned due to grpc/grpc-node#2002"
]
}
3 changes: 2 additions & 1 deletion sdk/nodejs/runtime/closure/createClosure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,8 @@ async function findNormalizedModuleNameAsync(obj: any): Promise<string | undefin
// don't pre-compute this because the require cache will get populated
// dynamically during execution.
for (const path of Object.keys(require.cache)) {
if (require.cache[path].exports === obj) {
const c = require.cache[path];
if (c !== undefined && c.exports === obj) {
// Rewrite the path to be a local module reference relative to the current working
// directory.
const modPath = upath.relative(process.cwd(), path);
Expand Down

0 comments on commit 08df93f

Please sign in to comment.