fix(stacks-svelte): pre-bundle dayjs plugins with .js extension to fix CI test flake#2224
Merged
dancormier merged 3 commits intobetafrom Apr 1, 2026
Merged
Conversation
…timizeDeps 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>
🦋 Changeset detectedLatest commit: 902ba40 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stacks-svelte ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stacks-utils/src/DateTimeFormatter.tsimportsdayjs/plugin/relativeTime.jsanddayjs/plugin/updateLocale.jswith explicit.jsextensionsvite.config.tslisted these inoptimizeDeps.includewithout the.jssuffix, so Vite didn't recognise them as pre-bundled.js-suffixed variants mid-test, triggered a re-optimisation + server reload, and killed the in-flight Navigation test module fetch — causingTypeError: Failed to fetch dynamically imported moduleFix: add
dayjs/plugin/relativeTime.jsanddayjs/plugin/updateLocale.jsalongside the existing entries so both forms are pre-bundled before tests start.Test plan
Unit Tests (stacks-svelte)job passes on this branch✨ optimized dependencies changed. reloadingin the test runner output🤖 Generated with Claude Code