Skip to content

Commit 051f747

Browse files
dancormierclaude
andauthored
fix(stacks-svelte): pre-bundle dayjs plugins with .js extension to fix CI test flake (#2224)
* fix(stacks-svelte): pre-bundle dayjs plugins with .js extension in optimizeDeps stacks-utils imports dayjs/plugin/relativeTime.js and updateLocale.js with explicit .js extensions. Vite's optimizeDeps.include entries without .js don't match these, so Vite discovers them as new deps mid-test run, triggers re-optimization + reload, and kills in-flight test module fetches (manifesting as a Navigation test import failure in CI). CI always has a cold Vite cache; locally the .js variants get cached on the first run, masking the issue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: trigger CI tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * changeset: patch for stacks-svelte dayjs optimizeDeps fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b58a0aa commit 051f747

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/swift-clocks-ring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@stackoverflow/stacks-svelte": patch
3+
---
4+
5+
Pre-bundle dayjs plugins with .js extension in optimizeDeps

packages/stacks-svelte/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export default defineConfig({
2121
"@stackoverflow/stacks-icons-legacy/icons",
2222
"dayjs",
2323
"dayjs/plugin/relativeTime",
24+
"dayjs/plugin/relativeTime.js",
2425
"dayjs/plugin/updateLocale",
26+
"dayjs/plugin/updateLocale.js",
2527
// svelte-sonner must be pre-bundled to ensure its virtual CSS modules
2628
// (from <style global> blocks) are properly resolved during test execution.
2729
// Without pre-bundling, CI environments may trigger mid-test re-optimization,

0 commit comments

Comments
 (0)