Vite 3.0.8 compatibility
See original GitHub issueHi
After upgrading to Vite 3.0.8 i encountered a problem.
Rollup/vite config:
import { defineConfig, loadEnv, PluginOption } from 'vite';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
resolve: {
preserveSymlinks: true,
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
define: {
APP_VERSION: JSON.stringify(env.npm_package_version),
},
build: {
emptyOutDir: true,
sourcemap: mode !== 'production',
},
// ...
plugins: [
react(),
// ...
visualizer({
brotliSize: true,
gzipSize: true,
template: 'treemap',
filename: 'stats/rollup-stats.html',
title: 'D-Main - Rollup (Build) stats',
}),
],
};
});
Versions and OS:
- macbook pro m1 macos 12.5
- vite: 3.0.8
- rollup-plugin-visualizer: 5.7.1
Error:
- Type ‘(PluginOption[] | Plugin)[]’ is not assignable to type ‘PluginOption[]’.
If I remove “visualizer(…)” or cast it as “PluginOption” than the error goes away. This error occurred only after upgrading from 3.0.1 to 3.0.8
Is this rollup plugin not compatible anymore with the newest version?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Vite 3.0 is out!
Compatibility Notes js 14.18+ / 16+ is now required. Vite is now published as ESM, with a CJS proxy to the ESM entry...
Read more >Vite 3.0 - New Features & Updates You Must Know - Radixweb
Compatibility Notes · Now NodeJS 14.18+ / 16+ is required as Vite no longer supports NodeJS 12/13/15, which reached its EOL. · With...
Read more >vite - npm
Native-ESM powered web dev build tool. Latest version: 4.0.3, last published: 2 days ago. Start using vite in your project by running `npm...
Read more >Vite Rollup Plugins
A list of rollup plugins compatibility for Vite ~3.0.0 ; alias. Define and resolve aliases for bundle dependencies ; auto-install · Automatically install ......
Read more >Installation | Vue CLI
⚠️ Vue CLI is in Maintenance Mode! For new projects, it is now recommended to use create-vue to scaffold Vite-based projects. Also refer...
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
@zmrl010 seems right, i will wait until vite 3.1. As workaround just cast to PluginOptions or pin rollup to 2.77.3
I added rollup to be optional peer dependency and it seems fixed the issue (need to drop node modules and lock file)