Skip to content

v1.6.1: Browser dist entry point is an empty stub, breaking all named exports #1402

Closed

Description

@eliaharris

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

  1. Install [email protected] (or jimp@^1.6.0 which resolves to 1.6.1)
  2. Use any bundler that respects the browser export condition in package.json (Rollup with @rollup/plugin-node-resolve({ browser: true }), Webpack, Stencil, etc.)
  3. Import named exports: import { Jimp, ResizeStrategy } from "jimp";
  4. 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').

Activity

  1. eliaharris commented on Apr 8, 2026

    @eliaharris
    Author

    As a side note, when I built Jimp locally, the dist folder looks correct. This just must have been some freak accident/caching issue.

  2. fvilers commented on Apr 25, 2026

    @fvilers

    I've got the same issue with a Svelte (5.55.2) and Vite (8.0.7) app while building on Node 22 (linux).

  3. Moumouls commented on May 9, 2026

    @Moumouls

    @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)

  4. daveroberts commented on Jun 9, 2026

    @daveroberts

    In case you're searching for the error message:

    The requested module doesn't provide an export named: 'Jimp'
    
  5. fitzyracing1 commented on Oct 12, 2026

    @fitzyracing1

    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

  6. added a commit that references this issue on Oct 20, 2026
  7. hipstersmoothie commented on Nov 22, 2026

    @hipstersmoothie
    Collaborator

    Fixed in v1.7.0: the published dist/browser/index.js is the full bundle again, with all named exports (Jimp, ResizeStrategy, …).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions