[Vite 3] Babel Bug
See original GitHub issueDescribe the bug
It seems that, in some scenarios, the babel plugin is trying to parse TypeScript code even though it’s not configured to be able to parse TypeScript. Which breaks both dev and build.
The same code does work with Vite 2.
This is a blocker for building Vike Frameworks. (And, AFAICT there is no workaround for this bug, but I could be wrong.)
The bug reproduction is minimal but uses VikePress; let me know if you want more minimal reproduction that doesn’t use VikePress.
This is the last bug for making Vite 3 + vite-plugin-ssr green again 🎉.
(I’m curious what the reason is for using Babel since esbuild supports JSX.)
Reproduction
https://github.com/brillout/vite-3-babel-bug
System Info
System:
OS: Linux 5.10 Debian GNU/Linux 10 (buster) 10 (buster)
CPU: (2) x64 Intel(R) Celeron(R) N4020 CPU @ 1.10GHz
Memory: 570.86 MB / 2.71 GB
Container: Yes
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 18.0.0 - ~/.config/nvm/versions/node/v18.0.0/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.6.0 - ~/.config/nvm/versions/node/v18.0.0/bin/npm
Browsers:
Firefox: 97.0.1
npmPackages:
vite: ^2.8.4 => 3.0.0-beta.5
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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 vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
@vitejs/plugin-react - npm
The all-in-one Vite plugin for React projects. ... dedupe the react and react-dom packages; use custom Babel plugins/presets.
Read more >Vite 4.0 is out!
Vite 3 was released five months ago. npm downloads per week have gone from 1 million to ... @vitejs/plugin-react is a plugin that...
Read more >vite:react-babel throwing error with Typescript ReturnType ...
Your project is using TypeScript version 4.3.2 . typeof useSearchFilters<T> is an instantiation expression. Those were first introduced in ...
Read more >@vitejs/plugin-react-refresh | Yarn - Package Manager
Provides React Refresh support for Vite. // vite.config.js import reactRefresh from '@vitejs/plugin-react-refresh' export default { plugins: ...
Read more >Options - Babel.js
The three primary cases users could run into are: ... containing a babel.config.json file, and throws an error if a babel.config.json is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in
beta.9
🎉Done: https://github.com/vitejs/vite/issues/8880. Let me know if there is anything I can do to help.