Skip to content
Back to skills

Nyxs React Compiler

ASecurity

How the React Compiler is set up in Nyxs and the bugs it causes. Use when changing vite.config.ts's plugins, when a component shows a stale value only in the built app, when reading module-level or global state during render, or when dev builds get slow or time out.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentsreact

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add nyxs-code/nyxs-code --skill nyxs-react-compiler --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nyxs React Compiler?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nyxs React Compiler
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nyxs-code-nyxs-react-compiler/badge)](https://www.skillsdirectory.com/skills/nyxs-code-nyxs-react-compiler)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nyxs-react-compiler
description: How the React Compiler is set up in Nyxs and the bugs it causes. Use when changing vite.config.ts's plugins, when a component shows a stale value only in the built app, when reading module-level or global state during render, or when dev builds get slow or time out.
---

# The React Compiler in Nyxs

`vite.config.ts` runs `babel({ presets: [reactCompilerPreset()] })` with **`apply: "build"`**:
it memoizes components in the built app only.

## Why only in the build

In dev, Babel ran on Vite's main thread and took seconds per file (App.tsx about 16 s cold):
the dev server stopped answering, Windows dropped the window's connections
(`ERR_CONNECTION_TIMED_OUT`), Settings showed a red error screen and Plugins took seconds to open.
Don't turn it on for `serve`. `src/App.tsx` is excluded too (`exclude`), and has `"use no memo"`.

## The bug it causes: a value read once

A compiled component that reads a value from outside React during render (a module variable, a
`Map`, `localStorage`, `Date.now()`) keeps the **first** value it read: the compiler memoizes the
render as if that read were pure. It works in dev (not compiled) and breaks only in the release.

Read outside state through a subscription:

```ts
const value = useSyncExternalStore(subscribe, () => store.get(key));
```

- The snapshot function must return the same object while nothing changed (keep a cached
  snapshot and replace it on change), or React loops.
- For the time, use `useMinuteClock()` (`src/lib/time.ts`) or a ticker state, not `Date.now()`
  in render.
- Examples: `SessionRecap.tsx` (recaps map), `sessionDirectory.ts`, `ultracode.ts`,
  `claudeCodeTasks.ts` (`getClaudeCodeTasks` snapshot).

## Opting out

A file that misbehaves under the compiler gets `"use no memo"` at the top, with a comment saying
why. Prefer fixing the read.

## Other build-time pieces

`zodSetup.ts` (imported first in `main.tsx`/`quick.tsx`) sets Zod to `jitless`, so it never
probes `eval` against the CSP. `lazyRetry` (`src/lib/lazyRetry.ts`) wraps lazy views: it retries a
failed chunk and reloads at most once a minute.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.