Skip to content

fix: Module doesn't provide an export named: 'jsx'#216

Open
edwinvakayil wants to merge 2 commits intocloudflare:mainfrom
edwinvakayil:fix/react-jsx-runtime
Open

fix: Module doesn't provide an export named: 'jsx'#216
edwinvakayil wants to merge 2 commits intocloudflare:mainfrom
edwinvakayil:fix/react-jsx-runtime

Conversation

@edwinvakayil
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module doesn't provide an export named: 'jsx'

1 participant