From 6fcaf0ce05eb63a37d570daaa1765c6bc34f4e94 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 8 Dec 2022 11:37:19 +0100 Subject: [PATCH] (fix) set watchFile polling interval marked as optional, but seems to be required in TS 4.9 --- .../language-server/src/plugins/typescript/service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/language-server/src/plugins/typescript/service.ts b/packages/language-server/src/plugins/typescript/service.ts index 30b0a01c0..ab75f4e2f 100644 --- a/packages/language-server/src/plugins/typescript/service.ts +++ b/packages/language-server/src/plugins/typescript/service.ts @@ -555,7 +555,11 @@ async function createLanguageService( } if (!configWatchers.has(tsconfigPath) && tsconfigPath) { - configWatchers.set(tsconfigPath, tsSystem.watchFile(tsconfigPath, watchConfigCallback)); + configWatchers.set( + tsconfigPath, + // for some reason setting the polling interval is necessary, else some error in TS is thrown + tsSystem.watchFile(tsconfigPath, watchConfigCallback, 1000) + ); } for (const config of extendedConfigPaths) { @@ -565,7 +569,8 @@ async function createLanguageService( extendedConfigWatchers.set( config, - tsSystem.watchFile(config, createWatchExtendedConfigCallback(docContext)) + // for some reason setting the polling interval is necessary, else some error in TS is thrown + tsSystem.watchFile(config, createWatchExtendedConfigCallback(docContext), 1000) ); } }