Skip to content

Commit f8ad318

Browse files
committed
Fix esbuild scanner error and type compatibility issues.
1 parent aefff20 commit f8ad318

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.notes/justin/worklogs/2025-09-21-fix-esbuild-scanner-error.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ The solution is to filter out virtual modules from the entry points before passi
5353

5454
Applied fix: Added a filter to remove any entry that contains `virtual:` before processing the entries for the esbuild scan.
5555

56-
#### Solution
57-
58-
Three fixes were applied to resolve the compatibility issues:
59-
60-
1. **Added `outdir` parameter**: The `esbuild` configuration now includes a path to the project's intermediate builds directory. Because the scanner is still configured with `write: false`, no files are actually written to disk. This satisfies the new requirement from `esbuild` while avoiding potential collisions between multiple projects.
61-
62-
2. **Filter virtual modules**: Entry points containing `virtual:` are now filtered out before being passed to esbuild, since virtual modules don't contain actual source code that can be scanned for directives.
63-
64-
3. **Fix plugin type compatibility**: Added explicit TypeScript types to plugin methods (`HotUpdateOptions` for `hotUpdate` and `ViteBuilder` for `buildApp`) to ensure compatibility between Vite versions.
65-
6656
## CI Type Compatibility Issue
6757

6858
After fixing the scanner issues, CI is now failing with TypeScript errors related to Vite type incompatibilities. The error shows that the SDK (compiled against Vite `7.1.5`) has incompatible types with the starters using Vite `7.1.6`.
@@ -114,4 +104,14 @@ A recent update to `vite` (from `7.1.5` to `7.1.6`) brought in a newer version o
114104

115105
2. The scanner began receiving virtual modules (like `virtual:cloudflare/worker-entry`) as entry points, which cannot be marked as external in esbuild, causing "cannot be marked as external" errors.
116106

117-
3. TypeScript compatibility issues arose between the SDK (compiled against Vite 7.1.5) and starters using Vite 7.1.6, causing plugin interface mismatches.
107+
3. TypeScript compatibility issues arose between the SDK (compiled against Vite 7.1.5) and starters using Vite 7.1.6, causing plugin interface mismatches.
108+
109+
#### Solution
110+
111+
Three fixes were applied to resolve the compatibility issues:
112+
113+
1. **Added `outdir` parameter**: The `esbuild` configuration now includes a path to the project's intermediate builds directory. Because the scanner is still configured with `write: false`, no files are actually written to disk. This satisfies the new requirement from `esbuild` while avoiding potential collisions between multiple projects.
114+
115+
2. **Filter virtual modules**: Entry points containing `virtual:` are now filtered out before being passed to esbuild, since virtual modules don't contain actual source code that can be scanned for directives.
116+
117+
3. **Fix plugin type compatibility**: Added explicit TypeScript types to plugin methods (`HotUpdateOptions` for `hotUpdate` and `ViteBuilder` for `buildApp`) to ensure compatibility between Vite versions.

0 commit comments

Comments
 (0)