Expected Behavior
dist/browser/index.js should contain the full pre-bundled browser build with all named exports (Jimp, ResizeStrategy, etc.), as it does in v1.6.0.
Current Behavior
In v1.6.1, dist/browser/index.js is a 3-line stub that exports nothing:
export {};
// A stub. The real build is done by rollup.
//# sourceMappingURL=index-browser.mjs.map
Similarly, dist/browser/index.d.ts is:
export {};
//# sourceMappingURL=index-browser.d.mts.map
This causes any bundler that resolves the browser export condition (e.g. Rollup's nodeResolve({ browser: true }), Webpack) to get an empty module. Named imports like import { Jimp, ResizeStrategy } from "jimp" silently resolve to undefined, causing runtime errors.
Failure Information (for bugs)
Steps to Reproduce
- Install
jimp@1.6.1 (or jimp@^1.6.0 which resolves to 1.6.1)
- Use any bundler that respects the
browser export condition in package.json (Rollup with @rollup/plugin-node-resolve({ browser: true }), Webpack, Stencil, etc.)
- Import named exports:
import { Jimp, ResizeStrategy } from "jimp";
- The imports resolve to
undefined because the browser entry point is a stub
Comparison:
| File |
v1.6.0 |
v1.6.1 |
dist/browser/index.js |
727KB, 236 lines, full bundle with exports |
98 bytes, stub: export {}; |
dist/browser/index.d.ts |
116KB, 1764 lines of type declarations |
55 bytes, stub: export {}; |
dist/browser/index.js.map |
2.9MB |
3.0MB (references full build sources) |
Note that the sourcemap in 1.6.1 references all the expected source files and is actually larger than the 1.6.0 sourcemap — suggesting the full Rollup build ran but its output was not written to dist/browser/index.js.
The package.json exports field still points to the stub:
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
}
}
Context
- Jimp Version: 1.6.1 (1.6.0 works correctly)
- Operating System: macOS Darwin 25.3.0
- Node version: v24.3.0
Failure Logs
jimp__WEBPACK_IMPORTED_MODULE_2__.ResizeStrategy).BILINEAR
^-- ResizeStrategy is undefined
Attempted import error: 'Jimp' is not exported from 'jimp' (imported as '$hgUW1$Jimp').
Expected Behavior
dist/browser/index.jsshould contain the full pre-bundled browser build with all named exports (Jimp,ResizeStrategy, etc.), as it does in v1.6.0.Current Behavior
In v1.6.1,
dist/browser/index.jsis a 3-line stub that exports nothing:Similarly,
dist/browser/index.d.tsis:This causes any bundler that resolves the
browserexport condition (e.g. Rollup'snodeResolve({ browser: true }), Webpack) to get an empty module. Named imports likeimport { Jimp, ResizeStrategy } from "jimp"silently resolve toundefined, causing runtime errors.Failure Information (for bugs)
Steps to Reproduce
jimp@1.6.1(orjimp@^1.6.0which resolves to 1.6.1)browserexport condition inpackage.json(Rollup with@rollup/plugin-node-resolve({ browser: true }), Webpack, Stencil, etc.)import { Jimp, ResizeStrategy } from "jimp";undefinedbecause the browser entry point is a stubComparison:
dist/browser/index.jsexport {};dist/browser/index.d.tsexport {};dist/browser/index.js.mapNote that the sourcemap in 1.6.1 references all the expected source files and is actually larger than the 1.6.0 sourcemap — suggesting the full Rollup build ran but its output was not written to
dist/browser/index.js.The
package.jsonexportsfield still points to the stub:Context
Failure Logs