Broken legacy build
See original GitHub issueDescribe the bug
Building with plugin-legacy seems to be broken
Reproduction
- create new project with
yarn create @vitejs/app
(template -react + ts
) - add @vitejs/plugin-legacy -
yarn add -D @vitejs/plugin-legacy
- update
vite.config.ts
-
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import reactRefresh from '@vitejs/plugin-react-refresh';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [legacy(), reactRefresh()],
});
- run
yarn build
// error
System Info
vite
version: 2.0.5- Operating System: Windows 10
- Node version: 14.15.5
- Package manager (npm/yarn/pnpm) and version: yarn@1.22.10
Logs (Optional if provided reproduction)
- Run
vite build
with the--debug
flag.
$ tsc && vite build --debug
vite:config bundled config file loaded in 201ms +0ms
vite:config using resolved config: {
vite:config plugins: [
vite:config 'alias',
vite:config 'react-refresh',
vite:config 'vite:dynamic-import-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'legacy-generate-polyfill-chunk',
vite:config 'legacy-env',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:build-html',
vite:config 'commonjs',
vite:config 'vite:data-uri',
vite:config 'rollup-plugin-dynamic-import-variables',
vite:config 'legacy-post-process',
vite:config 'vite:import-analysis',
vite:config 'vite:esbuild-transpile',
vite:config 'vite:terser',
vite:config 'vite:reporter'
vite:config ],
vite:config build: {
vite:config target: [ 'es2019', 'edge16', 'firefox60', 'chrome61', 'safari11' ],
vite:config polyfillDynamicImport: true,
vite:config outDir: 'dist',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: true,
vite:config sourcemap: false,
vite:config rollupOptions: { output: [Array] },
vite:config commonjsOptions: { include: [Array], extensions: [Array] },
vite:config minify: 'terser',
vite:config terserOptions: {},
vite:config cleanCssOptions: {},
vite:config write: true,
vite:config emptyOutDir: null,
vite:config manifest: false,
vite:config lib: false,
vite:config ssr: false,
vite:config ssrManifest: false,
vite:config brotliSize: true,
vite:config chunkSizeWarningLimit: 500
vite:config },
vite:config define: { 'import.meta.env.LEGACY': '__VITE_IS_LEGACY__' },
vite:config configFile: 'C:/Users/azymov/Documents/projects/vite-project/vite.config.ts',
vite:config inlineConfig: {
vite:config root: undefined,
vite:config base: undefined,
vite:config mode: undefined,
vite:config configFile: undefined,
vite:config logLevel: undefined,
vite:config clearScreen: undefined,
vite:config build: {}
vite:config },
vite:config root: 'C:/Users/azymov/Documents/projects/vite-project',
vite:config base: '/',
vite:config resolve: { dedupe: undefined, alias: [ [Object] ] },
vite:config publicDir: 'C:\\Users\\azymov\\Documents\\projects\\vite-project\\public',
vite:config command: 'build',
vite:config mode: 'production',
vite:config isProduction: true,
vite:config optimizeCacheDir: 'C:\\Users\\azymov\\Documents\\projects\\vite-project\\node_modules\\.vite',
vite:config server: {},
vite:config env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen]
vite:config },
vite:config createResolver: [Function: createResolver]
vite:config } +5ms
vite v2.0.5 building for production...
✓ 21 modules transformed.
[legacy-post-process] [BABEL] unknown: .plugins[36][0] must be a string, object, function
error during build:
Error: [BABEL] unknown: .plugins[36][0] must be a string, object, function
at assertPluginTarget (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67416:12)
at assertPluginItem (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67390:6)
at C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67373:15
at Array.forEach (<anonymous>)
at assertPluginList (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67372:10)
at C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67591:6
at Array.forEach (<anonymous>)
at validateNested (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67567:22)
at validate$3 (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67558:11)
at C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:69754:15
- Provide the error log here.
$ tsc && vite build
vite v2.0.5 building for production...
✓ 21 modules transformed.
[legacy-post-process] [BABEL] unknown: .plugins[36][0] must be a string, object, function
error during build:
Error: [BABEL] unknown: .plugins[36][0] must be a string, object, function
at assertPluginTarget (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67416:12)
at assertPluginItem (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67390:6)
at C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67373:15
at Array.forEach (<anonymous>)
at assertPluginList (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67372:10)
at C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67591:6
at Array.forEach (<anonymous>)
at validateNested (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67567:22)
at validate$3 (C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:67558:11)
at C:\Users\azymov\Documents\projects\vite-project\node_modules\@babel\standalone\babel.js:69754:15
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Amazon.com: Broken Legacy (Dark Legacy Book 3) eBook
Dark Legacy (dark and sexy contemp romance): Broken Wings. Broken Trust. Broken Legacy. Dylan. Secret Keepers (upper YA paranormal romance): House of Darken....
Read more >I'd like to make a character on standard soley for the ... - Reddit
The most broken standard exclusive build currently is Soulcatcher flask effect to reduce vaal skill cost to 0 in combination with 2 legacy...
Read more >Broken Legacy - Jaymin Eve - Goodreads
The last book in this story but not the last in the Dark Legacy world! The build up through all 3 books was...
Read more >Broken Legacy | Spotify
These cookies may be used to deliver targeted advertisements and to build a profile of your interests. If you do not allow these...
Read more >Broken Legacy - SoundCloud
Play Broken Legacy on SoundCloud and discover followers on SoundCloud | Stream tracks, albums, playlists on desktop and mobile.
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
@Eazymov since you’re using yarn, as a temporal workaround similar to the one on #2442, you can try and use selective resolution to pin the version. https://classic.yarnpkg.com/en/docs/selective-version-resolutions/#toc-how-to-use-it
Closing as duplicate of #2442