[PR #216] [CLOSED] fix: Module doesn't provide an export named: 'jsx' #395

Closed
opened 2026-05-06 12:39:36 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/216
Author: @edwinvakayil
Created: 3/1/2026
Status: Closed

Base: mainHead: fix/react-jsx-runtime


📝 Commits (2)

  • deb5245 fix: Module doesn't provide an export named: 'jsx'
  • 07252ab fix: Module doesn't provide an export named: 'jsx'

📊 Changes

5 files changed (+191 additions, -14 deletions)

View changed files

📝 README.md (+2 -0)
📝 packages/vinext/src/cli.ts (+10 -1)
📝 packages/vinext/src/index.ts (+41 -0)
📝 packages/vinext/src/server/prod-server.ts (+34 -7)
📝 tests/app-router.test.ts (+104 -6)

📄 Description

Fix dev JSX runtime error and vinext start RSC entry handling

Dev: react/jsx-runtime doesn't provide an export named jsx

Root optimizeDeps.include now forces pre-bundling of react, react-dom, react/jsx-runtime, and react/jsx-dev-runtime so the automatic JSX transform always resolves to a React copy that exports jsx (React 17+). Avoids the error when resolution or a duplicate React would otherwise use an older or wrong copy. README “Known limitations” documents the fix and suggests clearing node_modules/.vite and ensuring a single React 19 install if the error persists.

  • vinext start: RSC entry does not export a default handler function

The prod server now accepts both RSC entry shapes: a default function (request) => Promise<Response> (raw RSC entry from build) and a default object { fetch(request) } (Workers-style entry). It uses the function when present, otherwise calls default.fetch(request). vinext start works after vinext build whether the built dist/server/index.js is the raw RSC entry or the Workers entry. Includes a unit test that starts the prod server with a fake entry exporting { fetch } and asserts the response.

Resolves #143


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/216 **Author:** [@edwinvakayil](https://github.com/edwinvakayil) **Created:** 3/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/react-jsx-runtime` --- ### 📝 Commits (2) - [`deb5245`](https://github.com/cloudflare/vinext/commit/deb5245a955623de3c1354db65d581b1274acd4c) fix: Module doesn't provide an export named: 'jsx' - [`07252ab`](https://github.com/cloudflare/vinext/commit/07252aba8d58a0fc2dba0fd7913386522f178f50) fix: Module doesn't provide an export named: 'jsx' ### 📊 Changes **5 files changed** (+191 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -0) 📝 `packages/vinext/src/cli.ts` (+10 -1) 📝 `packages/vinext/src/index.ts` (+41 -0) 📝 `packages/vinext/src/server/prod-server.ts` (+34 -7) 📝 `tests/app-router.test.ts` (+104 -6) </details> ### 📄 Description **Fix dev JSX runtime error and vinext start RSC entry handling** Dev: `react/jsx-runtime` doesn't provide an export named `jsx` Root optimizeDeps.include now forces pre-bundling of `react`, `react-dom`, `react/jsx-runtime`, and `react/jsx-dev-runtime` so the automatic JSX transform always resolves to a React copy that exports jsx (React 17+). Avoids the error when resolution or a duplicate React would otherwise use an older or wrong copy. **README** “Known limitations” documents the fix and suggests clearing `node_modules/.vite` and ensuring a single **React 19** install if the error persists. - `vinext start`: **RSC entry does not export a default handler function** The prod server now accepts both RSC entry shapes: a default function `(request) => Promise<Response>` (raw RSC entry from build) and a default object `{ fetch(request) }` (Workers-style entry). It uses the function when present, otherwise calls `default.fetch(request)`. `vinext start` works after `vinext build` whether the built `dist/server/index.js` is the raw RSC entry or the Workers entry. Includes a unit test that starts the prod server with a fake entry exporting `{ fetch }` and asserts the response. Resolves #143 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:36 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#395
No description provided.