Problem
JSX in .js files breaks the Vite 8 / rolldown optimizeDeps dependency scanner.
react.dev keeps JSX in plain .js files (pages/404.js, pages/[[...markdownPath]].js, components/Layout/HomeContent.js, utils/prepareMDX.js, …) — Next/SWC handles this. vinext's main oxc transform handles it for SSR too, but the dep scanner has JSX disabled for .js:
(!) Failed to run dependency scan. Skipping dependency pre-bundling.
[PARSE_ERROR] Unexpected JSX expression
Help: JSX syntax is disabled and should be enabled via the parser options
This is non-fatal at boot but cascades: with pre-bundling skipped, UMD/CJS deps (e.g. classnames) aren't interop'd and then crash under SSR (window is not defined).
Workaround used
optimizeDeps: { rolldownOptions: { moduleTypes: { '.js': 'jsx' } } }
Suggested fix
vinext should configure the optimizeDeps scanner to treat the app's .js as JSX (mirroring how it already treats .js for the main transform), so apps with JSX-in-.js pre-bundle correctly out of the box.
Problem
JSX in
.jsfiles breaks the Vite 8 / rolldown optimizeDeps dependency scanner.react.dev keeps JSX in plain
.jsfiles (pages/404.js,pages/[[...markdownPath]].js,components/Layout/HomeContent.js,utils/prepareMDX.js, …) — Next/SWC handles this. vinext's main oxc transform handles it for SSR too, but the dep scanner has JSX disabled for.js:This is non-fatal at boot but cascades: with pre-bundling skipped, UMD/CJS deps (e.g.
classnames) aren't interop'd and then crash under SSR (window is not defined).Workaround used
Suggested fix
vinext should configure the optimizeDeps scanner to treat the app's
.jsas JSX (mirroring how it already treats.jsfor the main transform), so apps with JSX-in-.jspre-bundle correctly out of the box.