You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The restoreJSX function makes a simple assumption that all its inputs are valid jsx file because usually it is going to transform code from thrid-party libraries which only includes js code. However, it is also possible to see user source code from monorepo, where using React.createElement() in .ts files will throw a parsing error because babel was not configured to parse typescript.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Describe the bug
https://github.com/vitejs/vite/blob/dc323a0a230f57de0d102782dd4e673fb6b2d06c/packages/plugin-react/src/jsx-runtime/restore-jsx.ts#L68
The
restoreJSX
function makes a simple assumption that all its inputs are valid jsx file because usually it is going to transform code from thrid-party libraries which only includes js code. However, it is also possible to see user source code from monorepo, where usingReact.createElement()
in.ts
files will throw a parsing error because babel was not configured to parse typescript.Reproduction
https://stackblitz.com/edit/vitejs-plugin-react-restorejsx-bug?file=lib/index.ts
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: