Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/wiki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ lists its own pages.
| [guide](guide/README.md) | Using the plugin: getting started, fences, components, highlighting, icons, i18n, options. |
| [contributing](contributing/README.md) | Changing it: the module map, the local workflow, CI and releases. |
| [Troubleshooting](Troubleshooting.md) | The failures people actually hit. |
| [Roadmap](Roadmap.md) | What Phase 1 covers and what Phase 2 adds. |

Start with [Getting Started](guide/Getting-Started.md) — a site with a diagram, in
four files.
Expand Down
13 changes: 7 additions & 6 deletions docs/wiki/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The frame renders, the page answers 200, `astro build` exits 0 — and every
diagram still shows "Loading architecture diagram…". In the browser console:

```
[astro-island] Error hydrating /node_modules/@purview-dev/astroc4/src/components/LikeC4ProjectView.tsx
SyntaxError: The requested module '/node_modules/react/compiler-runtime.js?v=…'
[astro-island] Error hydrating @purview-dev/astroc4/src/components/LikeC4ProjectView.tsx
SyntaxError: The requested module 'react/compiler-runtime.js?v=…'
does not provide an export named 'c'
```

Expand All @@ -18,12 +18,12 @@ so it imports `c` from `react/compiler-runtime`. React 19 ships that entry point
as CommonJS:

```js
// node_modules/react/compiler-runtime.js
// react/compiler-runtime.js
module.exports = require('./cjs/react-compiler-runtime.development.js'); // exports.c = …
```

The island is `client:only="react"` and its source is in this package, so in
`astro dev` Vite can hand the browser `/node_modules/react/compiler-runtime.js`
`astro dev` Vite can hand the browser the `compiler-runtime.js` entry point
as-is instead of pre-bundling it into an ES module with a named `c` export. The
island then throws during hydration and stays on its
`slot="fallback"` placeholder. **`astro build` bundles the dependency
Expand Down Expand Up @@ -53,8 +53,9 @@ export default defineConfig({
});
```

Then delete `node_modules/.vite` (and any `.vite` cache under the site root) and
restart `astro dev`; the cache is why the failure can appear to come and go.
Then delete the `.vite` cache inside `node_modules` (and any `.vite` cache under
the site root) and restart `astro dev`; the cache is why the failure can appear
to come and go.

Do not treat the other workarounds people reach for as fixes: `client:only` is
already correct, pinning an older React or LikeC4 only hides the bug, and
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/guide/Plain-Astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default defineEcConfig({
`likec4Language` is the grammar snapshot bundled with the package, so this needs
no network. `await loadLikeC4Language({ ref: 'v1.60.0' })` fetches a different
one when the config is asynchronous, and
[Syntax Highlighting](Syntax-Highlighting.md#pinning-the-grammar) covers the
[Syntax Highlighting](Syntax-Highlighting.md#choosing-a-version) covers the
trade-off.

## What you give up
Expand Down
Loading