diff --git a/src/service-override/files.ts b/src/service-override/files.ts index 73a96921..869211b1 100644 --- a/src/service-override/files.ts +++ b/src/service-override/files.ts @@ -963,10 +963,14 @@ export async function initFile (file: URI, content: Uint8Array | string, options // The file already exists, do nothing return } catch (error) { + if (!(error instanceof FileSystemProviderError) || error.code !== FileSystemProviderErrorCode.FileNotFound) { + console.error('Unable to check if file exists', error) + } + // File not found, write it } } - await provider.writeFile(file, content instanceof Uint8Array ? content : encoder.encode(content), { + await provider.writeFile(file, encode(content), { atomic: false, create: true, overwrite: false,