This repository was archived by the owner on Mar 19, 2026. It is now read-only.
forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 19
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
cjs-esm interop may fail under some conditions #566
Copy link
Copy link
Description
Describe the bug
There seems to be some problems with the development mode packging:
File 1: import cjs through interop polyfill
import __vite__cjsImport33_____viteBrowserExternalDPaKxBqF_js from "/dist/__vite-browser-external-DPaKxBqF.js"; const require___vite_browser_external = __vite__cjsImport33_____viteBrowserExternalDPaKxBqF_js["t"];
var import_react = /* @__PURE__ */ __toESM(require_react());
File 2: imported by File 1
import {t as __commonJSMin} from "/dist/chunk-BgJFCHuQ.js";
var require___vite_browser_external = /* @__PURE__ */
__commonJSMin(( (e, t) => {
t.exports = {};
}
));
export {require___vite_browser_external as t};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIl9fdml0ZS1icm93c2VyLWV4dGVybmFsLURQYUt4QnFGLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHQgYXMgX19jb21tb25KU01pbiB9IGZyb20gXCIvZGlzdC9jaHVuay1CZ0pGQ0h1US5qc1wiO1xudmFyIHJlcXVpcmVfX192aXRlX2Jyb3dzZXJfZXh0ZXJuYWwgPSAvKiBAX19QVVJFX18gKi8gX19jb21tb25KU01pbigoKGUsIHQpID0+IHtcblx0dC5leHBvcnRzID0ge307XG59KSk7XG5leHBvcnQgeyByZXF1aXJlX19fdml0ZV9icm93c2VyX2V4dGVybmFsIGFzIHQgfTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQztBQUM1RCxHQUFHLENBQUMsK0JBQStCLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLGFBQWEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDL0UsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDZixDQUFDLENBQUMsQ0FBQztBQUNILE1BQU0sQ0FBQyxDQUFDLENBQUMsK0JBQStCLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDOyJ9
Will cause the following error:
Uncaught SyntaxError: The requested module '/dist/__vite-browser-external-DPaKxBqF.js' does not provide an export named 'default'
File 1 before dev packging:
import { t as require___vite_browser_external } from "./__vite-browser-external-DPaKxBqF.js";
var import_react = /* @__PURE__ */ __toESM(require_react());
Reproduction
https://github.com/StarHeartHunt/repro-cryptojs-rolldown
Steps to reproduce
pnpm install
pnpm build
pnpm dev
System Info
System:
OS: macOS 26.1
CPU: (14) arm64 Apple M4 Pro
Memory: 3.63 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.18.0 - /Users/ryannian/.local/state/fnm_multishells/59287_1766549046416/bin/node
npm: 10.9.3 - /Users/ryannian/.local/state/fnm_multishells/59287_1766549046416/bin/npm
pnpm: 10.26.1 - /Users/ryannian/.local/state/fnm_multishells/59287_1766549046416/bin/pnpm
bun: 1.3.3 - /Users/ryannian/.bun/bin/bun
Browsers:
Brave Browser: 140.1.82.173
Chrome: 143.0.7499.170
Firefox: 143.0.1
Safari: 26.1Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels