vite-bundle-visualizer icon indicating copy to clipboard operation
vite-bundle-visualizer copied to clipboard

TypeError: Cannot destructure property 'build' when running vite-bundle-visualizer

Open Hetari opened this issue 7 months ago • 1 comments

When running npx vite-bundle-visualizer -o ./stats.html, I encountered the following error:

npx vite-bundle-visualizer     
file:///home/brhoom/.npm/_npx/304071756d53c73c/node_modules/vite-bundle-visualizer/index.js:37
  const { build } = await importVite()
          ^

TypeError: Cannot destructure property 'build' of '(intermediate value)' as it is undefined.
    at start (file:///home/brhoom/.npm/_npx/304071756d53c73c/node_modules/vite-bundle-visualizer/index.js:37:11)
    at async file:///home/brhoom/.npm/_npx/304071756d53c73c/node_modules/vite-bundle-visualizer/bin.js:48:1

Node.js v18.20.6

Steps to Reproduce

  1. I use npx vite-bundle-visualizer by running
    npx vite-bundle-visualizer -o ./stats.html
    
  2. The error occurs.

Environment

  • Node.js version: v18.20.6
  • Vite version: v6.2.0
  • OS: Linux Mint 22

Hetari avatar Mar 08 '25 20:03 Hetari