Skip to content

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

@Hetari

Description

@Hetari

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions