Repository navigation
Description
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.mapSimilarly, dist/browser/index.d.ts is:
export {};
//# sourceMappingURL=index-browser.d.mts.mapThis 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
[email protected](orjimp@^1.6.0which resolves to 1.6.1) - Use any bundler that respects the
browserexport condition inpackage.json(Rollup with@rollup/plugin-node-resolve({ browser: true }), Webpack, Stencil, etc.) - Import named exports:
import { Jimp, ResizeStrategy } from "jimp"; - The imports resolve to
undefinedbecause 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').
Activity
eliaharris commentedon Apr 8, 2026
As a side note, when I built Jimp locally, the dist folder looks correct. This just must have been some freak accident/caching issue.
fvilers commentedon Apr 25, 2026
I've got the same issue with a Svelte (5.55.2) and Vite (8.0.7) app while building on Node 22 (linux).
Update dependencies to address security advisories
Moumouls commentedon May 9, 2026
@hipstersmoothie any chance you could try releasing the package again? @eliaharris mentioned that Jimp is building correctly, and the browser dist seems to exist on
master, to see if it helps here.(On my side i can confirm also the issue under storybook env with webpack 5 compiler)
daveroberts commentedon Jun 9, 2026
In case you're searching for the error message:
fix(three): load Jimp only for image operations (#1312)
fix(three): load Jimp only for image operations (anomalyco#1312)
fix: hold jimp at 1.6.0, whose successor has no browser build (#201)
Serve 6 fixed npm forks + labeled manual switch (implements #1); clea…
fitzyracing1 commentedon Oct 12, 2026
If you're blocked on the empty browser stub in 1.6.1, there's a temporary patched build with the real browser bundle (turbo build-order fix; Node builds match upstream):
npm install [email protected] --registry https://patch-cloud-production.up.railway.app
Happy to drop this once a corrected release is on npm. Fork: https://github.com/fitzyracing1/jimp/tree/patch-cloud
chore(release): 2.2.0 [skip ci]
hipstersmoothie commentedon Nov 22, 2026
Fixed in v1.7.0: the published
dist/browser/index.jsis the full bundle again, with all named exports (Jimp,ResizeStrategy, …).fix: order jimp's browser build after tshy and cache its output (#1402)…