question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Vite 3] Babel Bug

See original GitHub issue

Describe 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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
brilloutcommented, Jul 8, 2022

Fixed in beta.9 🎉

1reaction
brilloutcommented, Jul 1, 2022

Done: https://github.com/vitejs/vite/issues/8880. Let me know if there is anything I can do to help.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found