From 098703d2dcf92d95c9e93907e1f5a13cf3d95bd6 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 17 Sep 2025 14:34:24 -0700 Subject: [PATCH] fix: resolve bundler compatibility by avoiding fs/promises subpath import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace direct import of 'node:fs/promises' with 'node:fs' and access promises property. This fixes bundler issues with Vite/Webpack while maintaining full Node.js compatibility. 🤖 Generated with Claude Code Co-Authored-By: Claude --- src/universal/fs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/universal/fs.ts b/src/universal/fs.ts index 9b8a8344..742a041b 100644 --- a/src/universal/fs.ts +++ b/src/universal/fs.ts @@ -12,7 +12,9 @@ let nodeFs: any = null if (isNode()) { try { // Use node: protocol to prevent bundler polyfilling (requires Node 22+) - nodeFs = await import('node:fs/promises') + // Import main module and access promises to avoid subpath issues with bundlers + const fs = await import('node:fs') + nodeFs = fs.promises } catch { // Ignore import errors in non-Node environments }