Commit d39a2a1
committed
Bundle fallback data into SSR instead of reading repo-local files
The previous route fallback fix worked locally but still failed on production because the Netlify SSR runtime did not have repo-local JSON files available at the paths the helper searched.
Switch the fallback helper to raw-import the generated app, game, device, and YouTube JSON inputs so the SSR bundle carries the data it needs at runtime, independent of function working directory or file packaging quirks.
Constraint: Netlify SSR bundling does not reliably expose repo-local generated files as runtime-readable filesystem paths
Rejected: Rely on Netlify included_files for SSR bundle data | the generated SSR function archive still omitted the fallback files
Rejected: Fetch large fallback JSON over HTTP on each request | unnecessary network dependency for a server-side fallback path
Confidence: medium
Scope-risk: narrow
Reversibility: clean
Directive: Prefer bundler-native inclusion for SSR-only fallback data when runtime file availability is uncertain on Netlify
Tested: vitest ./test/prebuild/config-node.test.js ./test/prebuild/site-listings.test.js; pnpm run netlify-build
Not-tested: live production after redeploy1 parent 6cfbfbf commit d39a2a1
1 file changed
Lines changed: 12 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 10 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
22 | 15 | | |
23 | 16 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 17 | + | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
30 | 21 | | |
31 | | - | |
32 | | - | |
| 22 | + | |
| 23 | + | |
33 | 24 | | |
34 | 25 | | |
35 | 26 | | |
36 | 27 | | |
37 | | - | |
38 | 28 | | |
39 | 29 | | |
40 | | - | |
| 30 | + | |
41 | 31 | | |
42 | 32 | | |
43 | 33 | | |
| |||
0 commit comments