From 45616f112f63bf79ba0712b6b9c42bc99fef52d5 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 20 May 2025 12:21:16 +0000 Subject: [PATCH] fix(bazel): the "paths[0]" argument must be of type string. Received an instance of Buffer Workaround for ``` TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received an instance of Buffer at Object.resolve (node:path:1101:7) at fs.readdir (internal/node/node_patches.cjs:257:44) ``` --- bazel/integration/test_runner/runner.mts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bazel/integration/test_runner/runner.mts b/bazel/integration/test_runner/runner.mts index 681ed525b..84c0b6647 100644 --- a/bazel/integration/test_runner/runner.mts +++ b/bazel/integration/test_runner/runner.mts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import fs from 'node:fs/promises'; +import {rmSync, promises as fs} from 'node:fs'; import path from 'node:path'; import os from 'node:os'; @@ -88,7 +88,11 @@ export class TestRunner { // We keep the temporary directory on disk if the users wants to debug the test. if (!this.isTestDebugMode) { debug('Deleting the integration test temporary directory..'); - await fs.rm(testTmpDir, {force: true, recursive: true, maxRetries: 3}); + try { + rmSync(testTmpDir, {force: true, recursive: true, maxRetries: 3}); + } catch (e) { + console.error(`Failed to delete temporary directory: ${testTmpDir}`); + } } } }