Skip to content

Commit 453f16f

Browse files
bpamiriclaude
andauthored
docs(docs): document viteStrictManifest breaking default in CHANGELOG + 3.x→4.x upgrade guide (#2235)
Closes #2228. Surfaces the viteStrictManifest=true default change in all three required spots: CHANGELOG Breaking section, the numbered breaking- change list in the upgrade guide, and Common Issues. Appended as item 11 to preserve existing anchor slugs. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5de0f90 commit 453f16f

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ All historical references to "CFWheels" in this changelog have been preserved fo
104104
### Changed
105105

106106
- **Breaking:** CORS middleware default changed from wildcard `*` to deny-all. Apps must explicitly configure `allowOrigins` or set an explicit wildcard. (#2039)
107+
- **Breaking:** `viteStrictManifest` defaults to `true` — a missing Vite manifest entry now throws `Wheels.ViteAssetNotFound` in production instead of silently falling back (3.x behavior). Rebuild Vite assets during the upgrade window; to retain 3.x silent behavior, `set(viteStrictManifest=false)`. (#2133)
107108
- **Breaking:** `allowEnvironmentSwitchViaUrl` defaults to `false` in production (#2076)
108109
- **Breaking:** Reload password must be non-empty for environment switching in production (#2082)
109110
- **Breaking:** HSTS header defaults on in production (#2081)

web/sites/guides/src/content/docs/v4-0-0-snapshot/upgrading/3x-to-4x.mdx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88

99
import { Aside, CardGrid, LinkCard, Steps } from '@astrojs/starlight/components';
1010

11-
This guide walks every breaking change between Wheels 3.x and 4.0, with before/after code for each. Most 3.x apps upgrade in an afternoon. The pressure points are CORS defaults, the test base class rename, the `plugins/``packages/` split, and the `wheels` CLI command renames. Everything else is either additive or continues to work with a deprecation warning.
11+
This guide walks every breaking change between Wheels 3.x and 4.0, with before/after code for each. Most 3.x apps upgrade in an afternoon. The pressure points are CORS defaults, the test base class rename, the `plugins/``packages/` split, the `wheels` CLI command renames, and Vite manifest strictness (production now throws on missing entries — rebuild assets during the upgrade window). Everything else is either additive or continues to work with a deprecation warning.
1212

1313
**You'll learn:**
1414

@@ -37,7 +37,7 @@ This guide walks every breaking change between Wheels 3.x and 4.0, with before/a
3737

3838
</Steps>
3939

40-
## The ten breaking changes
40+
## The eleven breaking changes
4141

4242
Each item cites its `CHANGELOG.md` "Changed" or "Removed" entry. Where the skeleton blog post calls out a two-path upgrade, Path A (fix directly) is documented here; Path B (the Legacy Compatibility Adapter, #2015) is covered at the end.
4343

@@ -169,6 +169,28 @@ var svc = service("emailService");
169169

170170
`service()` is the new global helper (#1933); prefer it over reaching into the container.
171171

172+
### 11. Vite manifest strictness — missing entries throw in production
173+
174+
**CHANGELOG:** `Breaking: viteStrictManifest defaults to true` (#2133).
175+
176+
In 3.x, a missing entry in `public/assets/.vite/manifest.json` silently fell back to the raw source path. In 4.0, the default flips: `viteScriptTag()`, `viteStyleTag()`, and `vitePreloadTag()` throw `Wheels.ViteAssetNotFound` in production when the manifest doesn't contain the requested entrypoint. This catches stale-build deploys at first request instead of letting them ship broken `<script>` tags to the browser.
177+
178+
The most common failure mode is a deploy that pushes new CFML code without rebuilding the Vite bundle — the manifest on the server is older than the entrypoint referenced in a view.
179+
180+
**Recommended fix — rebuild assets as part of the deploy:**
181+
182+
```bash title="your shell (or CI/CD deploy step)"
183+
npm run build # produces public/assets/.vite/manifest.json
184+
```
185+
186+
**Escape hatch — restore 3.x silent-fallback behavior:**
187+
188+
```cfm {test:compile} title="config/settings.cfm"
189+
set(viteStrictManifest = false);
190+
```
191+
192+
Use the escape hatch only if you can't rebuild assets during the upgrade window — then flip it back on once your deploy pipeline emits the manifest reliably.
193+
172194
## Deprecations you should plan to address
173195

174196
### Plugins → packages
@@ -270,7 +292,7 @@ The `/_browser/home`, `/_browser/login`, `/_browser/dashboard`, `/_browser/login
270292

271293
**CHANGELOG:** `Legacy compatibility adapter for 3.x → 4.0 migration soft-landing` (#2015), shipped as `packages/legacyadapter/`.
272294

273-
When you can't fix all ten breaking items in one sprint, activate the adapter, ship the upgrade, and modernize incrementally:
295+
When you can't fix all eleven breaking items in one sprint, activate the adapter, ship the upgrade, and modernize incrementally:
274296

275297
```bash title="your shell"
276298
cp -r packages/legacyadapter vendor/legacyadapter
@@ -322,6 +344,7 @@ These are additive in 4.0 and worth adopting during the upgrade window:
322344
- **Test runner can't find specs.** Check for `tests/specs/functions/` — rename to `functional/`. See #1872.
323345
- **Plugin warning at startup.** Port to `packages/` (see above) or accept the warning until you do.
324346
- **JWT tokens reject as invalid after upgrade.** Algorithm validation is on. Confirm your issuer sets `alg` to a supported value and the signature verification path uses constant-time comparison. See #2079, #2086.
347+
- **`Wheels.ViteAssetNotFound` thrown on first request after deploy.** The deploy shipped code referencing a Vite entrypoint that isn't in the manifest. Rebuild Vite assets (`npm run build`) before deploy, or temporarily `set(viteStrictManifest=false)` to restore 3.x silent fallback. See #2133.
325348

326349
## Related guides
327350

0 commit comments

Comments
 (0)