Skip to content

fix: transform TSX before es-module-lexer when bundledDev is active#15013

Open
aayushbaluni wants to merge 2 commits intoremix-run:mainfrom
aayushbaluni:fix/14947-vite8-bundled-dev-lexer
Open

fix: transform TSX before es-module-lexer when bundledDev is active#15013
aayushbaluni wants to merge 2 commits intoremix-run:mainfrom
aayushbaluni:fix/14947-vite8-bundled-dev-lexer

Conversation

@aayushbaluni
Copy link
Copy Markdown

Problem

When using Vite 8's experimental.bundledDev, es-module-lexer receives raw TSX code that hasn't been transformed, causing build failures since the lexer can't parse JSX syntax.

Change

  • Route modules are now run through the Vite child compiler before chunk analysis
  • getExportNames falls back to esbuild transform when es-module-lexer fails on untransformed code
  • Babel route-exports plugin uses TypeScript/JSX parser plugins to handle raw TSX

Fixes #14947.

Made with Cursor

Route transforms now compile hook-provided sources via the child compiler
before chunk detection, and export scanning falls back through esbuild when
lexing fails. Babel parsing uses TS/JSX plugins for raw route modules.

Fixes remix-run#14947.
@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented May 2, 2026

Hi @aayushbaluni,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented May 2, 2026

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails with Vite 8 experimental.bundledDev

2 participants