Repository navigation
Description
Describe the bug
The bundled version of tsdown in Vite+ makes a require call to use picomatch. The following excerpt is from the distributed version of 0.1.23:
// @voidzero-dev\vite-plus-core\dist\tsdown\main-Cq8Is40L.js#L2,L11-L12
import { createRequire } from "node:module";
//#region ../../node_modules/.pnpm/tsdown@0.22.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.0_@tsdown+exe@0.22.0_@type_e80978d33a319eb1e0c97ec71b684e94/node_modules/tsdown/dist/general-D3muxt2f.mjs
const picomatch = createRequire(import.meta.url)("picomatch");As far as I can tell, this dates back to when #396 was merged - a quick look through the releases on NPM suggests that picomatch has never been correctly bundled and never been declared as a dependency.
Reproduction
https://github.com/kcastellino/tsdown-picomatch-repro
Steps to reproduce
Run pnpm install then vp pack
System Info
VITE+ - The Unified Toolchain for the Web
Environment:
Version 24.16.0
Source lts
Tool Paths:
node C:\Users\kiran\AppData\Local\Programs\vite-plus\js_runtime\node\24.16.0\node.exe
npm C:\Users\kiran\AppData\Local\Programs\vite-plus\js_runtime\node\24.16.0\npm.cmd
npx C:\Users\kiran\AppData\Local\Programs\vite-plus\js_runtime\node\24.16.0\npx.cmd
Package Manager:
Name pnpm
Version 11.5.0
Source packageManager
Source Path C:\Users\kiran\Projects\tsdown-picomatch-repro\tsdown-picomatch-repro\package.json
Project Root C:\Users\kiran\Projects\tsdown-picomatch-repro\tsdown-picomatch-repro
Bin Path C:\Users\kiran\AppData\Local\Programs\vite-plus\package_manager\pnpm\11.5.0\pnpm\bin\pnpm.cmd
VITE+ - The Unified Toolchain for the Web
vp v0.1.23
Local vite-plus:
vite-plus v0.1.23
Tools:
vite v8.0.14
rolldown v1.0.3
vitest v4.1.7
oxfmt v0.52.0
oxlint v1.67.0
oxlint-tsgolint v0.23.0
tsdown v0.22.0
Environment:
Package manager pnpm v11.5.0
Node.js v24.16.0Used Package Manager
pnpm
Logs
VITE+ - The Unified Toolchain for the Web
node:internal/modules/cjs/loader:1500
const err = new Error(message);
^
Error: Cannot find module 'picomatch'
Require stack:
- C:\Users\kiran\Projects\tsdown-picomatch-repro\tsdown-picomatch-repro\node_modules\.pnpm\@voidzero-dev+vite-plus-cor_f0d9d0e48805d507779d87285c4d073b\node_modules\@voidzero-dev\vite-plus-core\dist\tsdown\main-Cq8Is40L.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1500:15)
at wrapResolveFilename (node:internal/modules/cjs/loader:1071:27)
at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1095:10)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1116:12)
at Module._load (node:internal/modules/cjs/loader:1285:25)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1600:12)
at require (node:internal/modules/helpers:153:16)
at file:///C:/Users/kiran/Projects/tsdown-picomatch-repro/tsdown-picomatch-repro/node_modules/.pnpm/@voidzero-dev+vite-plus-cor_f0d9d0e48805d507779d87285c4d073b/node_modules/@voidzero-dev/vite-plus-core/dist/tsdown/main-Cq8Is40L.js:12:49
at ModuleJob.run (node:internal/modules/esm/module_job:439:25) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\kiran\\Projects\\tsdown-picomatch-repro\\tsdown-picomatch-repro\\node_modules\\.pnpm\\@voidzero-dev+vite-plus-cor_f0d9d0e48805d507779d87285c4d073b\\node_modules\\@voidzero-dev\\vite-plus-core\\dist\\tsdown\\main-Cq8Is40L.js'
]
}Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Reacted by MK (fengmk2)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Priority
None yet
Effort
None yet
Target date
None yet
Start date
None yet
Activity
fengmk2 commentedon Jun 1, 2026
Thank you for the feedback, I'll fix it as soon as possible.
fix(pack): bundle direct tsdown picomatch require (voidzero-dev#1732)