fix(build): compile dist with the production JSX transform
Summary
@astryxdesign/[email protected] — the current latest on npm — ships a dist compiled with the development JSX transform. 193 of its 479 dist files import react/jsx-dev-runtime and call jsxDEV, which React's production build does not export (exports.jsxDEV = void 0).
Any consumer that renders an Astryx component in production crashes:
TypeError: (0 , b.jsxDEV) is not a function
dist/AppShell/AppShell.js alone contains 29 jsxDEV calls, so a Next.js app that puts <AppShell> in a layout returns a 500 on every route. That is what happened to us in production — every page of our dashboard went down until we pinned back to 0.1.4:
GET / 500 TypeError: (0 , b.jsxDEV) is not a function
GET /sign-in 500 TypeError: (0 , j.jsxDEV) is not a function
The bug is invisible locally (dev builds load React's development runtime, where jsxDEV exists) and invisible at build time (bundlers happily bundle the import) — it only surfaces when a production render actually executes.
| version | jsxDEV occurrences in dist |
|---|---|
| 0.1.3 | 0 |
| 0.1.4 | 0 |
| 0.1.5 | 5696 |
The UMD bundle (unpkg/jsdelivr) is affected too.
Root cause
@babel/preset-react 8 changed the default for development from a hard-coded false to:
development = api.env(env => env === 'development'),
Babel's env name is BABEL_ENV || NODE_ENV || "development" — so with NODE_ENV unset, which is the normal state of a library build, development becomes true and every JSX call compiles to jsxDEV.
#3839 bumped @babel/preset-react 7.29.7 → 8.0.1 on Jul 11. No config changed; the meaning of the existing config did. 0.1.4 was cut before that bump, 0.1.5 after.
Minimal reproduction (the repo's own preset options, runtime: 'automatic' with no development):
preset-react 8.0.1, NODE_ENV unset → import { jsxDEV } from "react/jsx-dev-runtime" ❌
preset-react 8.0.1, NODE_ENV=production → import { jsx } from "react/jsx-runtime" ✅
preset-react 8.0.1, development: false → import { jsx } from "react/jsx-runtime" ✅
Building main today reproduces the broken dist — this is not a one-off CI fluke.
Fix
-
Pin
development: falsein the@babel/preset-reactoptions forcore,lab, andcharts. A published artifact should never depend on an ambient env var;NODE_ENV=productionin the release script would also work, but it leaves the same trap armed for anyone who builds by hand. -
Add
scripts/check-no-dev-jsx.mjs(modeled oncheck-use-client.mjs): scans the builtdistforreact/jsx-dev-runtime/jsxDEVand fails the build. Wired into thebuildscript of all three packages, and sinceprepackrunsbuild, a dev-JSXdistcan no longer be published.
lab and charts are private today, but they carry the same config and would ship the same broken artifact the day they are published — fixed here as well.
Verification
| check | result |
|---|---|
pnpm -F @astryxdesign/core build on current main's config |
❌ guard fails, exit 1 — 193 dist files flagged |
pnpm -F @astryxdesign/core build with this fix |
✅ 479 dist files, 0 dev JSX; AppShell.js back to react/jsx-runtime |
pnpm -F @astryxdesign/lab build |
✅ 107 files clean |
pnpm -F @astryxdesign/charts build |
✅ 31 files clean |
pnpm check:repo, eslint |
✅ pass |
Suggested follow-up
0.1.5 is still latest on npm and bricks every SSR consumer, so a patch release (or a deprecation of 0.1.5) seems worth doing quickly. Happy to adjust anything here.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| astryx | Preview, Comment | Jul 14, 2026 2:53pm |
Hi @fatwang2!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
PR Analysis Report
No new or modified components detected.
Bundle Size Summary
| Package | Size (ESM) | Size (CJS) | Gzipped |
|---|---|---|---|
| @astryxdesign/core | N/A | 4.6KB | 0B |
Accessibility Audit
Status: No accessibility violations detected.
Generated by PR Enrichment workflow | View full report
Thanks for the fix! 0.1.6 should be available now with your code :)