-
Notifications
You must be signed in to change notification settings - Fork 712
Closed
Copy link
Description
Reproduction link or steps
- Open https://stackblitz.com/edit/github-nci4o6nk-b1edypmd?file=src%2Ffile.js,src%2Ffile2.js,rolldown.config.mjs
pnpm iruns automaticallypnpm run buildruns automatically- output includes
import * as http$1 from "node:http";andimport * as http from "node:http";, while only oneimport { URL } from "node:net";exists - run
npm run build:upto use rollup - output includes only one
import * as http from "node:http";
What is expected?
Same namespace import statements are merged in output.
In other words,
import * as http from "node:http";
import { URL } from "node:net";
//#region src/file.js
console.log("file", http, URL);
//#endregion
//#region src/file2.js
console.log("file2", http, URL);
//#endregionis output.
What is actually happening?
Same namespace import statements are not merged in output.
In other words,
import * as http$1 from "node:http";
import * as http from "node:http";
import { URL } from "node:net";
//#region src/file.js
console.log("file", http$1, URL);
//#endregion
//#region src/file2.js
console.log("file2", http, URL);
//#endregionis output.
Also it seems a panick is happening as well
thread '' panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.44.2/src/runtime/task/state.rs:188:9:
assertion failed: prev.is_running()
worker (tid = 43) sent an error! unreachable
[Error [RuntimeError]: unreachable]
System Info
Stackblitz
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@rolldown/browser: 1.0.0-beta.8-commit.6aca0ceAny additional comments?
This isn't much important in terms of code size because you normally run a minifier (no minifier supports deduping it though). But it's important for dts generation as the renamed type name is included in the error message (related vitejs/vite#14582).
Reactions are currently unavailable