From 141aaf9d795d3a66a8496b05521bc2bc029d480c Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Thu, 16 Feb 2023 07:15:20 +0100 Subject: [PATCH 1/2] fix: `node:worker_threads` breaks on node 14 fixes #4184 --- packages/cspell/src/util/cache/fileEntryCache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cspell/src/util/cache/fileEntryCache.ts b/packages/cspell/src/util/cache/fileEntryCache.ts index 1f7f6a681dd2..254ff3acbf07 100644 --- a/packages/cspell/src/util/cache/fileEntryCache.ts +++ b/packages/cspell/src/util/cache/fileEntryCache.ts @@ -3,7 +3,7 @@ */ export type { FileDescriptor } from 'file-entry-cache'; -import { isMainThread } from 'node:worker_threads'; +import { isMainThread } from 'worker_threads'; import type { FileEntryCache as FecFileEntryCache } from 'file-entry-cache'; import * as file_entry_cache from 'file-entry-cache'; From c07ad3bffb954ec981cae1f5c0832e7ced49bd86 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Thu, 16 Feb 2023 08:16:59 +0100 Subject: [PATCH 2/2] Update fileEntryCache.ts --- packages/cspell/src/util/cache/fileEntryCache.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/cspell/src/util/cache/fileEntryCache.ts b/packages/cspell/src/util/cache/fileEntryCache.ts index 254ff3acbf07..6d49b2070b2a 100644 --- a/packages/cspell/src/util/cache/fileEntryCache.ts +++ b/packages/cspell/src/util/cache/fileEntryCache.ts @@ -3,12 +3,11 @@ */ export type { FileDescriptor } from 'file-entry-cache'; -import { isMainThread } from 'worker_threads'; - import type { FileEntryCache as FecFileEntryCache } from 'file-entry-cache'; import * as file_entry_cache from 'file-entry-cache'; import { mkdirSync } from 'fs'; import * as path from 'path'; +import { isMainThread } from 'worker_threads'; export type FileEntryCache = FecFileEntryCache;