Skip to content

Vite 8.0.0-beta.1: dev server with --experimentalBundle fails at runtime with "Uncaught ReferenceError: module is not defined" #553

@JE-lee

Description

@JE-lee

Describe the bug

When running the dev server with the new --experimentalBundle flag on Vite 8.0.0-beta.1, the page fails to render and the browser console shows Uncaught ReferenceError: module is not defined. Running dev without --experimentalBundle works fine.

Reproduction

https://github.com/JE-lee/rolldown-vite8-test

Steps to reproduce

pnpm install
pnpm dev --> open browser, the page is good
pnpm dev:bundle --> open browser, fails at runtime with "Uncaught ReferenceError: module is not defined"

System Info

Vite: 8.0.0-beta.1
@vitejs/plugin-vue2: 2.3.3
Node: 22.16.0 (also reproduces on 20.19.x)
OS: Linux
Browser: Chrome (latest)
Expected behavior
Dev server should run with --experimentalBundle without runtime errors.

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions