Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import pundleMiddleware from 'pundle-middleware'
✗ const pundleMiddleware = require('pundle-middleware')
Package is ESM-only from v1.0.0; no CommonJS export.
createMiddleware
✓ import { createMiddleware } from 'pundle-middleware'
✗ import { createMiddleware } from 'pundle-middleware'
The named export exists but is not documented; use default import for reliability.
PundleMiddlewareOptions
✓ import type { PundleMiddlewareOptions } from 'pundle-middleware'
✗ import { PundleMiddlewareOptions } from 'pundle-middleware'
Type import only; not a runtime value. Available in TypeScript.
Shows how to integrate Pundle middleware with Express for HMR and file watching.
import express from 'express';
import pundleMiddleware from 'pundle-middleware';
import { createPundle } from 'pundle';
const app = express();
const pundle = createPundle({
entry: './src/index.js',
output: { format: 'esm', dir: './dist' },
});
app.use(pundleMiddleware(pundle, {
hmr: true,
watch: true,
}));
app.listen(3000);
Debug
Known issues
breakingv2.0.0-alpha1 completely rebuilt; API is incompatible with v1.xfixCheck changelog for migration guide; use v1.x if stable required.
affects: >=2.0.0-alpha1 <2.0.0
deprecatedNamed export createMiddleware may be deprecated in favor of default exportfixUse default import to ensure compatibility.
affects: >=1.0.0
gotchaPackage is ESM-only; using require() will throw Error [ERR_REQUIRE_ESM]fixUse import or configure CommonJS interop.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require with ESM-only package
fixSwitch to import syntax or use dynamic import().
Cannot find module 'pundle'
Pundle core not installed as dependency
fixRun: npm install pundle
Audit
Dependencies
pundlerequiredCore bundler required for middleware to function
expressrequiredPeer dependency for Express integration