Commit 1022a87
fix(landing): render hero ER graph on GitHub Pages
Two coupled production-only failures kept the inline module on index.html
from ever building the hero graph:
1. prismjs/components/prism-sql references the global Prism at module top
level, which is undefined under ESM. The manualChunks rule also bundled
core and the language file into a single vendor-prism chunk, so even a
dynamic import would still trigger prism-sql synchronously when the
chunk evaluated. Import Prism as a value, assign window.Prism, then
dynamic-import prism-sql; split prismjs/components/* out of vendor-prism
so the language chunk only evaluates after the global is set.
2. Using top-level await for that dynamic import turned the inline module
into an asynchronous evaluation, letting window.load fire before
addEventListener("load", buildHeroGraph) ran. The handler was never
invoked and the canvas stayed blank with no console error. Use
fire-and-forget dynamic import so the module finishes evaluating
synchronously; syntax highlighting can fail silently without taking
the hero down with it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 981feb2 commit 1022a87
2 files changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1954 | 1954 | | |
1955 | 1955 | | |
1956 | 1956 | | |
1957 | | - | |
1958 | | - | |
| 1957 | + | |
1959 | 1958 | | |
1960 | 1959 | | |
1961 | 1960 | | |
1962 | 1961 | | |
1963 | 1962 | | |
1964 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
1965 | 1972 | | |
1966 | 1973 | | |
1967 | 1974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
0 commit comments