Commit 9c49d3d
committed
fix(chat, strategy-curator): set output.assetPrefix so federated sub-chunks resolve against the remote's own origin, not the host's
Both remotes had `dev.assetPrefix` set (correct for local federation dev)
but no `output.assetPrefix` — the field that also applies to production
builds. Without it, a remote's async sub-chunks (e.g. chat's
__federation_expose_mount.js) resolve as relative paths against whatever
page loaded them — the shell's origin, not the remote's — so on the real
deploy every chat sub-chunk 404'd against augment.didi.sh and got back
the shell's own SPA-fallback HTML, which the browser then tried to eval
as JS ("SyntaxError: Unexpected token '<'"). Caught via a live browser
check against the actual deployed augment.didi.sh, not a local test —
this only reproduces cross-origin.
New PUBLIC_CHAT_ASSET_PREFIX / PUBLIC_STRATEGY_CURATOR_ASSET_PREFIX env
vars (localhost defaults preserved for dev), threaded through as Docker
build args. Verified locally: built each image with the real deployed
origin as the arg, extracted dist/, confirmed remoteEntry.js references
the correct origin instead of relative paths.
Files changed:
- apps/chat/rsbuild.config.ts
- apps/chat/Dockerfile
- apps/strategy-curator/rsbuild.config.ts
- apps/strategy-curator/Dockerfile1 parent f6d7ec3 commit 9c49d3d
4 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| |||
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| 38 | + | |
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
| |||
41 | 52 | | |
42 | 53 | | |
43 | 54 | | |
44 | | - | |
| 55 | + | |
45 | 56 | | |
46 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| |||
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
41 | | - | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
0 commit comments